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

Re: namespace and XPath question

Subject: Re: namespace and XPath question
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Wed, 22 Aug 2001 14:07:40 -0400
to include namespace in xpath
Following up on Jeni's post, her solution will include the "XCBL30.sox"
namespace in the output.  If you don't want that, you can add the attribute
exclude-result-prefixes attribute to the <stylesheet> tag like this:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:x="XCBL30.sox" exclude-result-prefixes='x'
version="1.0">
<xsl:output method="xml" version="1.0" indent="yes" encoding="UTF-8"/>

<xsl:template match="/">
<PO>
<BuyerOrderNumber>
<xsl:value-of
select="//x:Order/x:OrderHeader/x:OrderNumber/x:BuyerOrderNumber"/>
</BuyerOrderNumber>
</PO>
</xsl:template>
</xsl:stylesheet>

Cheers,

Tom P


[partner com]

> I am trying to use this XSL:
>
>
> <?xml version="1.0" ?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:output method="xml" version="1.0" indent="yes" encoding="UTF-8"/>
>
> <xsl:template match="/">
> <PO>
> <BuyerOrderNumber>
> <xsl:value-of select="//Order/OrderHeader/OrderNumber/BuyerOrderNumber"/>
> </BuyerOrderNumber>
> </PO>
> </xsl:template>
> </xsl:stylesheet>
>
>
> to translate this XML:
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <Order xmlns="XCBL30.sox">
>   <OrderHeader >
>     <OrderNumber>
>       <BuyerOrderNumber>PO123</BuyerOrderNumber>
>     </OrderNumber>
>   </OrderHeader>
> </Order>
>
>
>
> However, I only get this (not able to get the value)
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
> <PO>
> <BuyerOrderNumber></BuyerOrderNumber>
> </PO>
>
>
> Is there something wrong with my XSL?  Do I need to include the
> xmlns="XCBL30.sox" and how do I do that?
>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

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
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.