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

Re: XSL and Namespace Question

  • From: "Steve Muench" <smuench@u...>
  • To: "Michael Wiechers" <MichaelW@r...>
  • Date: Sun, 9 Apr 2000 17:57:34 -0700

xlink xmlns
Future XSL questions are best directed to xsl-list@m...

Here's some helpful hints...

| <NavigationElement xlink:href="index.xml" xlink:title="Overview"
| xml-href="true"/>
|
| I don't get the href value using <xsl:value-of select="@href"/>.

For the first one, you need to qualify href with xlink:href...

<?xml version="1.0"?>
<NavigationElement xmlns:xlink="urn:xlink"
     xlink:href="index.xml"
     xlink:title="Overview"
     xml-href="true"/>

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xlink="urn:xlink" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
  <xsl:template match="/NavigationElement">
    Href = <xsl:value-of select="@xlink:href"/>
  </xsl:template>
</xsl:stylesheet>

| <Meta xmlns="meta.dtd">
| <Title>
| title
| </Title>
| </Meta>
|
| <xsl:value-of select="Meta/Title"/>, works only if i remove the xmlns
| declaration.

For the second one, you're hitting a limitation of
XPath 1.0 regarding default namespaces. You must
explicitly associate a prefix with the namespace uri
"meta.dtd" and then use that prefix to find Meta/Title
as meta:Meta/meta:Title as in:

<Meta xmlns="meta.dtd">
 <Title>title</Title>
</Meta>

<?xml version="1.0"?>
<xsl:stylesheet xmlns:M="meta.dtd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:template match="/">
    Title = <xsl:value-of select="M:Meta/M:Title"/>
  </xsl:template>
</xsl:stylesheet>

______________________________________________________________
Steve Muench, Lead XML Evangelist & Consulting Product Manager
Business Components for Java & XSQL Servlet Development Teams
Oracle Rep to the W3C XSL Working Group



***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************

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.