[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] RE: Namespace use cases
- From: Robert Koberg <rob@koberg.com>
- To: Sean McGrath <sean.mcgrath@propylon.com>
- Date: Sat, 11 Jul 2009 08:20:09 -0700
On Jul 11, 2009, at 8:08 AM, Sean McGrath wrote:
> Anyway, I have a trick I use every day for namespaced XML processing
> and I strongly recommend it
> to everyone : mask them.
>
> Start your processing pipelines by masking the namespaces. E.g.
>
> transform this:
> <h:table xmlns:h="http://www.w3.org/TR/html4/">
>
> to this:
> <h_table xmlns_h="http://www.w3.org/TR/html4/">
>
> Now, go about your business processing the data and when you are ready
> to re-serialize to disk, do the transform in reverse. E.g.
>
> transform this:
> <h_table xmlns_h="http://www.w3.org/TR/html4/">
> to this:
> <h:table xmlns:h="http://www.w3.org/TR/html4/">
>
> Obviously, I don't do it prefix by prefix. I use utilities that
> transform all prefixes and all namespace
> declarations.
>
> It works a treat:-)
Maybe I am missing the utility of this because of too simple an
example, but why would you do this?
Why not use an identity transformation on things in the HTML namespace?
Why is it better to remove the ability to match at the namespace level?
<xsl:template match="@*|h:*">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
?
-Rob
>
> Sean
> http://seanmcgrath.blogspot.com
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]