|
-
April 20th, 2005, 01:53 AM
#1
Attributes order after XSLT transformation
Hi - this is my another problem wyth xslt transformation
I'm using XSLT below
Code:
<xsl:output method="xml" version="1.0" encoding="utf-8" omit-xml-declaration="no"/>
<xsl:template match="/">
<xsl:element name="ofe:ofe" namespace="urn:ofe">
<xsl:attribute name="wersja">
<xsl:text>1.0</xsl:text>
</xsl:attribute>
</xsl:element>
and I'm getting result:
Code:
<?xml version="1.0"?>
<ofe:ofe wersja="1.0" xmlns:ofe="urn:ofe"/>
which it's ok but order of parameters is not correct
it should be
Code:
<?xml version="1.0"?>
<ofe:ofe xmlns:ofe="urn:ofe" wersja="1.0" />
Please help - what I have to do to change it?
Big thanx in advance.
-
April 20th, 2005, 04:51 AM
#2
Re: Attributes order after XSLT transformation
It would surprise me if that was possible. At least not consistently.
In XML attributes may not be assigned an order.
Most likely the XSL processor stores the 2 attributes in a hash table before outputting them, thus their order depends on the order of their hash key values, which could be anything.
I'am sorry this was probably not the answer you wanted.
Last edited by khp; April 20th, 2005 at 04:55 AM.
The biggest problem encountered while trying to design a system that was completely foolproof,
was, that people tended to underestimate the ingenuity of complete fools.
Douglas Adams
-
April 20th, 2005, 05:32 AM
#3
Re: Attributes order after XSLT transformation
Hi,
maybe I can add one attribute and later (in loop or something) add another assuring in that way correct order of them? Do you think it will be possible?
-
April 20th, 2005, 06:53 AM
#4
Re: Attributes order after XSLT transformation
No, there's a limit to how much later you can add more attributes to an element in XSL. As soon as you begin producing element content you cannot add more attributes.
The biggest problem encountered while trying to design a system that was completely foolproof,
was, that people tended to underestimate the ingenuity of complete fools.
Douglas Adams
-
April 20th, 2005, 07:39 AM
#5
Re: Attributes order after XSLT transformation
 Originally Posted by khp
I'am sorry this was probably not the answer you wanted. 
Yes - really. Anyway; thanx for your time. If anything sometime comes to your mind please post it it here. Thanx.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|