Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8296505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T15:02:21+00:00 2026-06-08T15:02:21+00:00

I am using an xslt transformation to transform some xml files. In order to

  • 0

I am using an xslt transformation to transform some xml files. In order to format the output, what i am using is two tags in the xsl style sheet.

<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>

But the problem is , in windows i am getting a kind of output , and when i run the program in a unix machine, i am getting a different kind of output.
eg:

<Book name="Godfather" author="MarioPuzo"/>

But in unix, what i am getting is ,

<Book author="MarioPuzo" name="Godfather" />

it is kind of a weird problem. Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T15:02:23+00:00Added an answer on June 8, 2026 at 3:02 pm

    In XML there is no standard ordering defined in the set of the attributes of an element — this can be different from implementation to implementation.

    Also, in case the only difference between two XML documents is the order of attributes, they are considered “equal” — for example the XPath 2.0 function deep-equal($doc1, $doc2) produces true().

    This is analogous to a class definition — two class definitions in which the only difference is the ordering of the properties (or methods) are the same class definition and can be substituted with each other without causing different result from any program that uses instances of this class definition.

    Here is a demo of the fact that two documents are considered “equal” if the only differences are ordering of attributes:

    <xsl:stylesheet version="2.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xsl:output omit-xml-declaration="yes" indent="yes"/>
    
        <xsl:variable name="vDoc2">
         <t y="2"   x="1" />
        </xsl:variable>
    
     <xsl:template match="/">
         <xsl:sequence select="deep-equal(/, $vDoc2)"/>
     </xsl:template>
    </xsl:stylesheet>
    

    When this transformation is applied on the following XML document:

    <t x="1" y="2"/>
    

    the result is:

    true
    

    Even if some hack is found for the attributes to appear in a particular order for a given implementation both of an XML parser and of an XSLT processor), this hack is not guaranteed to work with the next version of this implementation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I transform some RSS XML feeds using XSLT. Basically there are two types I
I'm using xslt 1.0 to transform some xml returned via a Server.Execute on an
I'm using XSLT to transform RSS files in XHTML. In order to create a
I am using xalan 2.7.1 to validate my xml docs with xslt style sheet.
I'm using Xsl transformation to display an Xml data as Html. <xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform
I am using xslt 2.0 for transforming one xml format to another xml format.But
I'm using XSLT 1.0 an want to transform an XML file. It works fine
I'm trying to extract some information from an xml file using xslt. I've used
I'm using an XsltCompiledTransform to transform some XML into a fragment of HTML (not
I'm working on a XSLT transformation that consists on merging two XML and then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.