[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: 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

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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.