[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL / XML initial tag incompatibility
At 2005-03-23 20:46 +0300, yechiel lewis wrote:
I'm fairly new to XSL and have a problem matching the initial tags in my XSL file with the corresponding tags in the matching XML file. All of your XPath expressions need to have the elements qualified with a prefix. Your document element (what you call "the inital tag") contains a declaration of the default namespace, which means all of the unprefixed elements in your XML are namespace qualified. XPath respects unprefixed element names as always in no namespace, so this obligates the stylesheet writer to use prefixed names in XPath expressions when the names being matched are namespace qualified. So, where you have: <xsl:stylesheet version="1.0" xmlns:xsl="http://www .w3.org/1999/XSL/Transform"> ... <xsl:template match="Unit"> you will need: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:jeff="http://www.CpmXmlReport.co.il"> ... <xsl:template match="jeff:Unit"> when your XML reads: <Report xmlns="http://www.CpmXmlReport.co.il"> ... <Unit ID="1" Type="LAN"> Of course you can use any prefix you wish, I'm not sure which one you might want to use, but the above will work because prefixes are irrelevant in XML Namespaces. I hope this helps. ....................... Ken
|
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
|