[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Quick way to change element names
I have a batch of documents that began life as plain old HTML and converted them to XML using James Clark's SX utility. Now I need to change all the tags in each file from the current format that looks like this: <p>blah blah blah</p> to something that looks like this: <xhtml:p>blah blah blah</xhtml:p> My first attempt was to try this: <xsl:for-each select="*"><xsl:element name="{concat('xhtml:',name())}"><xsl:apply-templates/></xsl:element> The above is simplified as there are attributes and the like in the mix but it worked fairly except in circumstances where things are nested more than two layers deep. I'm looking for a quick way to change the tags from <myTag/> to <xhtml:myTag/> using XSL. I suppose this could be accomplished through some sort of find/replace macro but I'd prefer to run a transform on the whole batch and have done with it. Any suggestions? TIA, Chris
|
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
|