Search the web
Sign In
New User? Sign Up
xml-litprog-l · Literate Programming using XML
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
xslt question (derived from use of xmlp)   Message List  
Reply | Forward Message #197 of 238 |
RE: [xml-litprog-l] xslt question (derived from use of xmlp)

XPath expressions do not recognize default namespaces. In your stylesheet
add:

<xsl:stylesheet
...
xmlns:xhtml="http://www.w3.org/1999/xhtml"
...>

Then, change your select to:

<xsl:for-each select="/xhtml:html/xhtml:BODY/xhtml:H1">

-----Original Message-----
From: professorCharlie [mailto:charlie@...]
Sent: Monday, June 03, 2002 2:13 PM
To: xml-litprog-l@yahoogroups.com
Subject: [xml-litprog-l] xslt question (derived from use of xmlp)


Tony, you suggested that I could just add in my own table of content
handling. I'm new to XSL and XSLT, and I spent a huge amount of time
trying to get a very simple TOC template added to weave-xhtml.xsl.
I'm hoping you or someone reading this list can help me out.

I tried adding:

<xsl:template match="lp:table-of-contents">
testing
<xsl:for-each select="/html/BODY/H1">
<xsl:element name = "h2">
<xsl:value-of select="."/>
</xsl:element>
</xsl:for-each>
</xsl:template>

to the end of weave-xhtml.xsl (just before the close stylesheet
element).

The problem is that if the document I'm processing contains
a default namespace declaration:

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:lp="http://www.xmLP.org/2001/ns/xmLP/" version="-//W3C//DTD
XHTML 1.1//EN">

then the select never matches anything. If I delete the default
namespace declaration from the document I'm processing:

<html xmlns:lp="http://www.xmLP.org/2001/ns/xmLP/"
version="-//W3C//DTD XHTML 1.1//EN">

Then the select finds the H1 tag as expected. This seems backwards.




====
Unsubscribe: xml-litprog-l-unsubscribe@yahoogroups.com
Post message: xml-litprog-l@yahoogroups.com
http://groups.yahoo.com/group/xml-litprog-l/

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/




Mon Jun 3, 2002 6:45 pm

David.LaPorte@...
Send Email Send Email

Forward
Message #197 of 238 |
Expand Messages Author Sort by Date

Tony, you suggested that I could just add in my own table of content handling. I'm new to XSL and XSLT, and I spent a huge amount of time trying to get a very...
professorCharlie
professorCha...
Offline Send Email
Jun 3, 2002
6:13 pm

XPath expressions do not recognize default namespaces. In your stylesheet add: <xsl:stylesheet ... xmlns:xhtml="http://www.w3.org/1999/xhtml" ...> Then, change...
LaPorte, David A
David.LaPorte@...
Send Email
Jun 3, 2002
6:46 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help