Subject: Re: [xsl] trying to figure out handling namespace issues From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 12 Dec 2008 15:53:28 -0500 |
I continue to have problems getting my brain to understand how to handle namespace problems. I think I have broken one down simple enough to get help on. (Using Saxon 9)
Basically I have this xsl:
<xsl:for-each select="child::*[1]">
3)<xsl:value-of select="name(.)"/>#
</xsl:for-each>
<xsl:for-each select="div">
4)<xsl:value-of select="name(.)"/>#
</xsl:for-each>
and this output: 3)div#
---
The problem, there is no "4)div#"
I realize it is because of a namespace problem, but I don't know how to solve it. Help?
1. Is there a way that I can write some xsl, that will give me temporary output so I can figure out what I need to add to my xsl so that "4)div#" will work without looking at the xml? (I ask this, because sometimes the xml I am working with is huge and it is easy to get lost).
2. Following are the files I am using, stripped down as much as I dared. How can I modify my XSL so the "4)div#" works with a direct select statement instead of *[1]? (because it won't always be in the first position)
________ XSL file ____________________ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="xsl"> ... <xsl:for-each select="div"> 4)<xsl:value-of select="name(.)"/>#
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> ... <xsl:for-each select="h:div"> 4)<xsl:value-of select="name(.)"/>#
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xpath-default-namespace="http://www.w3.org/1999/xhtml"> ... <xsl:for-each select="div"> 4)<xsl:value-of select="name(.)"/>#
-- Upcoming XSLT/XSL-FO, UBL and code list hands-on training classes: : Sydney, AU 2009-01/02; Brussels, BE 2009-03; Prague, CZ 2009-03 Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video sample lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg Video course overview: http://www.youtube.com/watch?v=VTiodiij6gE G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] trying to figure out handling, Fred Christian | Thread | Re: [xsl] trying to figure out hand, Fred Christian |
[xsl] trying to figure out handling, Fred Christian | Date | [xsl] possible workarounds to proce, Matthias Einbrodt |
Month |