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

Re: can you select name() of attributes?

Subject: Re: can you select name() of attributes?
From: "Ragulf Pickaxe" <jawxml@xxxxxxxxxxx>
Date: Wed, 28 Jul 2004 06:28:37 +0000
pickaxe uses
Goodmorning (well, it is morning where I am),

This is in reply to David Carlisle's post, but anyone input is of course gladly received.

David Carlisle:
The old line is commented out. I found that the old one would copy every
attribute from $Doc1 if but one attribute of the same name exists in $Doc2.


I don't think it should, what processor?

I am using .NET 2003 and don't know which XSL processor it uses (other than being Microsoft). Is there some way of seeing this?



You have changed


[foo = bar] to [not(foo != bar)]

these two expressions are not in general equivalent (eg if either foo or
bar is a node set) but in your case both are the result of the name()
function so they are strings, and for strings these expressions are
equivalent.

You are absolutely right, I realise (after looking at the code again). Nevertheless, this is the behavior it exhibits, and I remembered reading about [not(A!=B)] being - in general - unequal to [A=B]. Changing this in the second 'copy-of' made it all right.


I have this morning tested my program, and the behaviour of your solution differs under the following conditions (still using .NET 2003):

Doc1.xml
<Input>
<I q="input value" s="Invalid attribute">Input</I>
</Input>

Doc2.xml
<A>
<B q="default" r="default">Text1</B>
</A>

When attribute 's' comes before 'q' in the input document (Doc1.xml), then it gives the expected output (with some permutations in the order of attributes):
<Output r="default" q="input value">Some text in the output element</Output>


When the attribute 's' comes after 'q' in the input (as shown above), it gives this result:
<Output r="default" s="Invalid attribute" q="input value">Some text in the output element</Output>.


I realise that this is not a conformant behavior, but it is the results that I get.

Regards,
Ragulf Pickaxe

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail


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.