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

Re: Confusing namespaces and xslt

Subject: Re: Confusing namespaces and xslt
From: Paul <pflists@xxxxxxxxx>
Date: Mon, 29 Sep 2008 15:44:34 -0400
Re:  Confusing namespaces and xslt
Thanks!

Your suggestion allows me to access a specific value.

What would be the best way to actually take the input xml transform it
into a new xml and just change a value or add a new element?

Would it be best to do a template match on "/" and do a for-each on
each element and then test each element to see if it was the one I
wanted to change?

Would it be better to set up specify template match statements for
each of the top-level elements and output the xml from the input
document except in the case where I need to change it?

Thanks,
Paul

On Mon, Sep 29, 2008 at 2:45 PM, Houghton,Andrew <houghtoa@xxxxxxxx> wrote:
>> From: Paul Ferwerda [mailto:pflists@xxxxxxxxx]
>> Sent: Monday, September 29, 2008 2:37 PM
>> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>> Subject:  Confusing namespaces and xslt
>>
>> I have a newbie question. I've gone round and around on this issue and
>> haven't been able to make any headway on my own. I suspect I'm missing
>> some basic understanding of how to use XPath expressions and how
>> namespaces are used. so I apologize in advance if the question is a
>> stupid one.
>>
>> I need to handle the following xml and generate new xml that makes
>> some changes to some of the attributes;
>>
>> [...]
>>
>
> In your XSL, on the stylesheet or transform element declare the namespace with whatever prefix you desire.  That will allow you to use that prefix in your XPath statements.  So:
>
> <xsl:stylesheet version="1.0"
>  xmlns:client="http://somecompany.com/box/client"
>  xmlns:box="http://somecompany.com/box"
>>
>
> Now in your XPath:
>
> /client:box-client/client:network/box:components
>
>
> Andy.

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-2011 All Rights Reserved.