sudheer2250 0 Light Poster

Hi,

I am applying transform to a input xml file using the following code.

//Applying transform for the input word xml file.
                    XslTransform myXslTransform;
                    myXslTransform = new XslTransform();
                    myXslTransform.Load(openFileDialogz_Xslt.FileName);
                    myXslTransform.Transform("C://Target.xml", targetpath);

In the XSLT file, wrote for displaying attributes as

<xsl:attribute name="label">
              <xsl:value-of select="$level"/>
            </xsl:attribute>


            <xsl:attribute name="externalid">
              <xsl:value-of select="$externalid"/>
            </xsl:attribute>
            <xsl:attribute name="displayorder">
              <xsl:text>0</xsl:text>
            </xsl:attribute>

            <xsl:attribute name="type">
              <xsl:text>Question</xsl:text>
            </xsl:attribute>

But in the output XML the attributes are displaying in the following order...

-<Mynode displayorder="0" label="label" questiontype="Question" externalid="extnid"></Question>

---------------------------------------------------------------------------------------

When i runt the XSLT to the XML file from the 'Visual studio->XML->StartWithoutDebugging'
menu in visual studio 2010..i am getting the attributes order correctly as i mentioned in the XSLT file as below...

<Mynode label="label" externalid="extnid" displayorder="0" questiontype="Question">
        </Question>

I did not understand what is the problem.....Please help me any one...I am struct with this problem from past 3 days..


Thanks in advance...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.