|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: RE: Namespace use cases
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] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








