Solved

XSL transfer to include inline schema

Posted on 2006-11-13
7
607 Views
Last Modified: 2013-11-19
Hi Have an XML file that gets transformed to another XML file (some nodes are added). It worked fine until I added the XML schema in the original XML File.

I would like to have the Schema copied over to the output file (copy as is).

here is the XSLT that i am using: (thanks to Gertone for helping me get this far)

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>
  <xsl:template match="NR">
    <xsl:copy>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="NR_DATA">
    <xsl:copy>
      <xsl:copy-of select="node()"/>
      <xsl:if test="count(NR_PART_REPLACMENT) &lt; 4">
        <xsl:call-template name="putExtraParts">
          <xsl:with-param name="cnt" select="4 - count(NR_PART_REPLACMENT) "/>
        </xsl:call-template>
      </xsl:if>
    </xsl:copy>
  </xsl:template>
  <xsl:template name="putExtraParts">
    <xsl:param name="cnt"/>
    <xsl:if test="$cnt &gt; 0">
      <NR_PART_REPLACMENT>
        <NRPR_ID></NRPR_ID>
        <NRPR_NR_ID></NRPR_NR_ID>
      </NR_PART_REPLACMENT>
      <xsl:call-template name="putExtraParts">
        <xsl:with-param name="cnt" select="$cnt - 1"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>

HERE IS THE ORIGINAL XML (THIS ONE WORKS)
<?xml version="1.0" encoding="utf-16"?>
<NR>
  <NR_DATA>
    <NR_ID>1</NR_ID>
    <NR_PD_ID>1</NR_PD_ID>
    <NR_NRP_ID>1</NR_NRP_ID>
    <NR_WC_ID>16459</NR_WC_ID>
    <NR_WC_NUMBER>24-011-01-03</NR_WC_NUMBER>
    <NR_ATA_CODE>24</NR_ATA_CODE>
    <NR_ATA_SECTION>SYSTEMS AND POWERPLANT</NR_ATA_SECTION>
    <NR_ATA_SUBSECTION />
    <NR_CONTROL_NUMBER>C_1501</NR_CONTROL_NUMBER>
    <NR_TAIL_NUMBER>N2590G</NR_TAIL_NUMBER>
    <NR_SERVICE>CHECK</NR_SERVICE>
    <NR_STATION>IK</NR_STATION>
    <NR_DATE>2006-08-14T04:12:00-04:00</NR_DATE>
    <NR_ZONE>432</NR_ZONE>
    <NR_SKILL>ENGIN</NR_SKILL>
    <NR_ORIG_BY>0</NR_ORIG_BY>
    <NR_INSP_REQUIRED>0</NR_INSP_REQUIRED>
    <NR_APPROVAL_BY />
    <NR_ESTIMATED_MH_INSP>0</NR_ESTIMATED_MH_INSP>
    <NR_ESTIMATED_MH_MECH>0</NR_ESTIMATED_MH_MECH>
    <NR_STATUS>NEW</NR_STATUS>
    <NR_REQUISITION />
    <NR_REF_TYPE />
    <NR_REF_NUMBER />
    <NR_REF_LOCATION />
    <NR_CREATEDBY_ID>17</NR_CREATEDBY_ID>
    <NR_CREATEDBY_NAME>operator</NR_CREATEDBY_NAME>
    <NR_LAST_PRINT_URL>www</NR_LAST_PRINT_URL>
    <NR_DISCREPANCY>
      <NRD_ID>1</NRD_ID>
      <NRD_NR_ID>1</NRD_NR_ID>
      <NRD_DISCREPANCY>fff</NRD_DISCREPANCY>
      <NRD_CORRECTIVE_ACTION>gg</NRD_CORRECTIVE_ACTION>
      <NRD_ORDER>0</NRD_ORDER>
    </NR_DISCREPANCY>
    <NR_PART_REPLACMENT>
      <NRPR_ID>1</NRPR_ID>
      <NRPR_NR_ID>1</NRPR_NR_ID>
      <NRPR_PN_OFF>1</NRPR_PN_OFF>
      <NRPR_PN_ON>2</NRPR_PN_ON>
      <NRPR_SN_OFF>3</NRPR_SN_OFF>
      <NRPR_SN_ON>4</NRPR_SN_ON>
      <NRPR_TAG>5</NRPR_TAG>
      <NRPR_ORDER>0</NRPR_ORDER>
    </NR_PART_REPLACMENT>
  </NR_DATA>
</NR>


HERE IS THE NEW XML (I NEED THE TRANSFORMATION TO WORK ON THIS ONE):


<?xml version="1.0" encoding="utf-16"?>
<xs:schema id="NR" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="NR" msdata:IsDataSet="true" msdata:Locale="">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="NR_DATA">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="NR_ID" type="xs:int" minOccurs="0" />
              <xs:element name="NR_PD_ID" type="xs:int" minOccurs="0" />
              <xs:element name="NR_NRP_ID" type="xs:int" minOccurs="0" />
              <xs:element name="NR_WC_ID" type="xs:int" minOccurs="0" />
              <xs:element name="NR_WC_NUMBER" type="xs:string" minOccurs="0" />
              <xs:element name="NR_ATA_CODE" type="xs:string" minOccurs="0" />
              <xs:element name="NR_ATA_SECTION" type="xs:string" minOccurs="0" />
              <xs:element name="NR_ATA_SUBSECTION" type="xs:string" minOccurs="0" />
              <xs:element name="NR_CONTROL_NUMBER" type="xs:string" minOccurs="0" />
              <xs:element name="NR_TAIL_NUMBER" type="xs:string" minOccurs="0" />
              <xs:element name="NR_SERVICE" type="xs:string" minOccurs="0" />
              <xs:element name="NR_STATION" type="xs:string" minOccurs="0" />
              <xs:element name="NR_DATE" type="xs:dateTime" minOccurs="0" />
              <xs:element name="NR_ZONE" type="xs:string" minOccurs="0" />
              <xs:element name="NR_SKILL" type="xs:string" minOccurs="0" />
              <xs:element name="NR_ORIG_BY" type="xs:int" minOccurs="0" />
              <xs:element name="NR_INSP_REQUIRED" type="xs:int" minOccurs="0" />
              <xs:element name="NR_APPROVAL_BY" type="xs:string" minOccurs="0" />
              <xs:element name="NR_ESTIMATED_MH_INSP" type="xs:double" minOccurs="0"/>
              <xs:element name="NR_ESTIMATED_MH_MECH" type="xs:double" minOccurs="0"/>
              <xs:element name="NR_STATUS" type="xs:string" minOccurs="0" />
              <xs:element name="NR_REQUISITION" type="xs:string" minOccurs="0" />
              <xs:element name="NR_REF_TYPE" type="xs:string" minOccurs="0" />
              <xs:element name="NR_REF_NUMBER" type="xs:string" minOccurs="0" />
              <xs:element name="NR_REF_LOCATION" type="xs:string" minOccurs="0" />
              <xs:element name="NR_CREATEDBY_ID" type="xs:int" minOccurs="0" />
              <xs:element name="NR_CREATEDBY_NAME" type="xs:string" minOccurs="0" />
              <xs:element name="NR_LAST_PRINT_URL" type="xs:string" minOccurs="0" />
              <xs:element name="NR_DISCREPANCY" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="NRD_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="NRD_NR_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="NRD_DISCREPANCY" type="xs:string" minOccurs="0" />
                    <xs:element name="NRD_CORRECTIVE_ACTION" type="xs:string" minOccurs="0" />
                    <xs:element name="NRD_ORDER" type="xs:int" minOccurs="0" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="NR_PART_REPLACMENT" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="NRPR_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="NRPR_NR_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="NRPR_PN_OFF" type="xs:string" minOccurs="0" />
                    <xs:element name="NRPR_PN_ON" type="xs:string" minOccurs="0" />
                    <xs:element name="NRPR_SN_OFF" type="xs:string" minOccurs="0" />
                    <xs:element name="NRPR_SN_ON" type="xs:string" minOccurs="0" />
                    <xs:element name="NRPR_TAG" type="xs:string" minOccurs="0" />
                    <xs:element name="NRPR_ORDER" type="xs:int" minOccurs="0" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="NR_ATTACHMENT" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="FL_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="FL_OWNER_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="FL_OWNER_TYPE" type="xs:int" minOccurs="0" />
                    <xs:element name="FL_FILE_TYPE" type="xs:string" minOccurs="0" />
                    <xs:element name="FL_FILE_NAME" type="xs:string" minOccurs="0" />
                    <xs:element name="FL_ORDER" type="xs:int" minOccurs="0" />
                    <xs:element name="FL_NOTE" type="xs:string" minOccurs="0" />
                    <xs:element name="FL_DATA" type="xs:base64Binary" minOccurs="0" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1">
      <xs:selector xpath=".//NR_DATA" />
      <xs:field xpath="NR_ID" />
    </xs:unique>
    <xs:keyref name="ATTACHMENTS" refer="Constraint1" msdata:IsNested="true">
      <xs:selector xpath=".//NR_ATTACHMENT" />
      <xs:field xpath="FL_OWNER_ID" />
    </xs:keyref>
    <xs:keyref name="PARTS" refer="Constraint1" msdata:IsNested="true">
      <xs:selector xpath=".//NR_PART_REPLACMENT" />
      <xs:field xpath="NRPR_NR_ID" />
    </xs:keyref>
    <xs:keyref name="DISCREPANCY" refer="Constraint1" msdata:IsNested="true">
      <xs:selector xpath=".//NR_DISCREPANCY" />
      <xs:field xpath="NRD_NR_ID" />
    </xs:keyref>
  </xs:element>
</xs:schema>
<xs:schema id="NR" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="NR" msdata:IsDataSet="true" msdata:Locale="">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="NR_DATA">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="NR_ID" type="xs:int" minOccurs="0" />
              <xs:element name="NR_PD_ID" type="xs:int" minOccurs="0" />
              <xs:element name="NR_NRP_ID" type="xs:int" minOccurs="0" />
              <xs:element name="NR_WC_ID" type="xs:int" minOccurs="0" />
              <xs:element name="NR_WC_NUMBER" type="xs:string" minOccurs="0" />
              <xs:element name="NR_ATA_CODE" type="xs:string" minOccurs="0" />
              <xs:element name="NR_ATA_SECTION" type="xs:string" minOccurs="0" />
              <xs:element name="NR_ATA_SUBSECTION" type="xs:string" minOccurs="0" />
              <xs:element name="NR_CONTROL_NUMBER" type="xs:string" minOccurs="0" />
              <xs:element name="NR_TAIL_NUMBER" type="xs:string" minOccurs="0" />
              <xs:element name="NR_SERVICE" type="xs:string" minOccurs="0" />
              <xs:element name="NR_STATION" type="xs:string" minOccurs="0" />
              <xs:element name="NR_DATE" type="xs:dateTime" minOccurs="0" />
              <xs:element name="NR_ZONE" type="xs:string" minOccurs="0" />
              <xs:element name="NR_SKILL" type="xs:string" minOccurs="0" />
              <xs:element name="NR_ORIG_BY" type="xs:int" minOccurs="0" />
              <xs:element name="NR_INSP_REQUIRED" type="xs:int" minOccurs="0" />
              <xs:element name="NR_APPROVAL_BY" type="xs:string" minOccurs="0" />
              <xs:element name="NR_ESTIMATED_MH_INSP" type="xs:double" minOccurs="0" />
              <xs:element name="NR_ESTIMATED_MH_MECH" type="xs:double" minOccurs="0" />
              <xs:element name="NR_STATUS" type="xs:string" minOccurs="0" />
              <xs:element name="NR_REQUISITION" type="xs:string" minOccurs="0" />
              <xs:element name="NR_REF_TYPE" type="xs:string" minOccurs="0" />
              <xs:element name="NR_REF_NUMBER" type="xs:string" minOccurs="0" />
              <xs:element name="NR_REF_LOCATION" type="xs:string" minOccurs="0" />
              <xs:element name="NR_CREATEDBY_ID" type="xs:int" minOccurs="0" />
              <xs:element name="NR_CREATEDBY_NAME" type="xs:string" minOccurs="0" />
              <xs:element name="NR_LAST_PRINT_URL" type="xs:string" minOccurs="0" />
              <xs:element name="NR_DISCREPANCY" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="NRD_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="NRD_NR_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="NRD_DISCREPANCY" type="xs:string" minOccurs="0" />
                    <xs:element name="NRD_CORRECTIVE_ACTION" type="xs:string" minOccurs="0" />
                    <xs:element name="NRD_ORDER" type="xs:int" minOccurs="0" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="NR_PART_REPLACMENT" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="NRPR_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="NRPR_NR_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="NRPR_PN_OFF" type="xs:string" minOccurs="0" />
                    <xs:element name="NRPR_PN_ON" type="xs:string" minOccurs="0" />
                    <xs:element name="NRPR_SN_OFF" type="xs:string" minOccurs="0" />
                    <xs:element name="NRPR_SN_ON" type="xs:string" minOccurs="0" />
                    <xs:element name="NRPR_TAG" type="xs:string" minOccurs="0" />
                    <xs:element name="NRPR_ORDER" type="xs:int" minOccurs="0" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="NR_ATTACHMENT" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="FL_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="FL_OWNER_ID" type="xs:int" minOccurs="0" />
                    <xs:element name="FL_OWNER_TYPE" type="xs:int" minOccurs="0" />
                    <xs:element name="FL_FILE_TYPE" type="xs:string" minOccurs="0" />
                    <xs:element name="FL_FILE_NAME" type="xs:string" minOccurs="0" />
                    <xs:element name="FL_ORDER" type="xs:int" minOccurs="0" />
                    <xs:element name="FL_NOTE" type="xs:string" minOccurs="0" />
                    <xs:element name="FL_DATA" type="xs:base64Binary" minOccurs="0" />
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1">
      <xs:selector xpath=".//NR_DATA" />
      <xs:field xpath="NR_ID" />
    </xs:unique>
    <xs:keyref name="ATTACHMENTS" refer="Constraint1" msdata:IsNested="true">
      <xs:selector xpath=".//NR_ATTACHMENT" />
      <xs:field xpath="FL_OWNER_ID" />
    </xs:keyref>
    <xs:keyref name="PARTS" refer="Constraint1" msdata:IsNested="true">
      <xs:selector xpath=".//NR_PART_REPLACMENT" />
      <xs:field xpath="NRPR_NR_ID" />
    </xs:keyref>
    <xs:keyref name="DISCREPANCY" refer="Constraint1" msdata:IsNested="true">
      <xs:selector xpath=".//NR_DISCREPANCY" />
      <xs:field xpath="NRD_NR_ID" />
    </xs:keyref>
  </xs:element>
</xs:schema>

<NR>
  <NR_DATA>
    <NR_ID>1</NR_ID>
    <NR_PD_ID>1</NR_PD_ID>
    <NR_NRP_ID>1</NR_NRP_ID>
    <NR_WC_ID>16459</NR_WC_ID>
    <NR_WC_NUMBER>24-011-01-03</NR_WC_NUMBER>
    <NR_ATA_CODE>24</NR_ATA_CODE>
    <NR_ATA_SECTION>SYSTEMS AND POWERPLANT</NR_ATA_SECTION>
    <NR_ATA_SUBSECTION />
    <NR_CONTROL_NUMBER>C_1501</NR_CONTROL_NUMBER>
    <NR_TAIL_NUMBER>N2590G</NR_TAIL_NUMBER>
    <NR_SERVICE>CHECK</NR_SERVICE>
    <NR_STATION>IK</NR_STATION>
    <NR_DATE>2006-08-14T04:12:00-04:00</NR_DATE>
    <NR_ZONE>432</NR_ZONE>
    <NR_SKILL>ENGIN</NR_SKILL>
    <NR_ORIG_BY>0</NR_ORIG_BY>
    <NR_INSP_REQUIRED>0</NR_INSP_REQUIRED>
    <NR_APPROVAL_BY />
    <NR_ESTIMATED_MH_INSP>0</NR_ESTIMATED_MH_INSP>
    <NR_ESTIMATED_MH_MECH>0</NR_ESTIMATED_MH_MECH>
    <NR_STATUS>NEW</NR_STATUS>
    <NR_REQUISITION />
    <NR_REF_TYPE />
    <NR_REF_NUMBER />
    <NR_REF_LOCATION />
    <NR_CREATEDBY_ID>17</NR_CREATEDBY_ID>
    <NR_CREATEDBY_NAME>operator</NR_CREATEDBY_NAME>
    <NR_LAST_PRINT_URL>http://</NR_LAST_PRINT_URL>
    <NR_DISCREPANCY>
      <NRD_ID>1</NRD_ID>
      <NRD_NR_ID>1</NRD_NR_ID>
      <NRD_DISCREPANCY>fff</NRD_DISCREPANCY>
      <NRD_CORRECTIVE_ACTION>gg</NRD_CORRECTIVE_ACTION>
      <NRD_ORDER>0</NRD_ORDER>
    </NR_DISCREPANCY>
    <NR_PART_REPLACMENT>
      <NRPR_ID>1</NRPR_ID>
      <NRPR_NR_ID>1</NRPR_NR_ID>
      <NRPR_PN_OFF>1</NRPR_PN_OFF>
      <NRPR_PN_ON>2</NRPR_PN_ON>
      <NRPR_SN_OFF>3</NRPR_SN_OFF>
      <NRPR_SN_ON>4</NRPR_SN_ON>
      <NRPR_TAG>5</NRPR_TAG>
      <NRPR_ORDER>0</NRPR_ORDER>
    </NR_PART_REPLACMENT>
  </NR_DATA>
</NR>
0
Comment
Question by:ANAT2403
  • 4
  • 3
7 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 17930181
Hi ANAT2403,

do you physically add the schema to the xml?
should you not just add a reference to the schema

The XML as you sent it is not well-formed
you should only have one root element

if you really want schema and xml in one file, you will need some sort of wrapper element
<wrapper>
<schema>schema goes here</schema>
<nr>xml goes here</nr>
</wrapper>

so I was wondering,
what is not working? The schema inclusion or the XSLT?

Cheers!
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 17930195
ANAT2403,

after your schema is included correctly
it is just a matter of adding something like this to the xslt

<xsl:template match="xs:schema">
    <xsl:copy-of select="."/>
</xsl:template>

cheers

Geert
0
 

Author Comment

by:ANAT2403
ID: 17930328
Hi Geert,

when I add:

<xsl:template match="xs:schema">
    <xsl:copy-of select="."/>
</xsl:template>

the transformation fails, when i have the xslt open in the design environment (VS2005) it states that prefix xs is not defined.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:ANAT2403
ID: 17930363
The Xml i posted should have the <NR> open tag above the  <xs:schema>  tag. that should make it a valid XML.
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 17930875
ANAT2403,

here is the new start of your stylesheet

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xsl:template match="/">
        <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="NR">
        <xsl:copy>
            <xsl:copy-of select="xs:schema"/>
            <xsl:apply-templates select="NR_DATA"/>
        </xsl:copy>
    </xsl:template>
    ...

in the stylesheet element I define your xs namespace (the schema one)
and in the template for NR, I now
- specify the selected node for the apply-templates (NR_DATA) in order to exclude the schema
- and I explicitely copy the schema

cheers

Geert
0
 

Author Comment

by:ANAT2403
ID: 17937342
Hi Geert,

This works well, thanks again for all your help.

I have 3 question regarding what you did.

1) the sections that are added to the xml now are added with the complete namespace. can this be removed?
   <NR_PART_REPLACMENT xmlns:xs="http://www.w3.org/2001/XMLSchema">

2) the section that is added is added without the whitespace (Enters and Tabs) between the elements can the whitespaces be added or can i set the newlines and tabs manually (\r\n or something of that nature).

3) Is there an easy application to use for creating such transformation files, i downloaded Altova's suite but i am having a hard time getting it to do anything useful.

Thanks again
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 17937642
1) removing the spurious namespace nodes is always a bit tricky,
the good thing is that they don't hurt

You could try to remove the xs namespace nod from the stylesheet element and move it to the schema node
something like this
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
    <xsl:template match="/">
        <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="NR">
        <xsl:copy>
            <xsl:copy-of select="xs:schema" xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
            <xsl:apply-templates select="NR_DATA"/>
        </xsl:copy>
    </xsl:template>

or have an exclude prefix in the stylesheet element
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  exclude-result-prefixes="xs" ...

2) the toplevel element <xsl:output/> helps you specifying the serialisation

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">
     <xsl:output indent="yes"/>
    <xsl:template match="/"> ....
adds some white-space

3) I don't like the graphical stuff too much, but stylus studio xslt designer can do something for you
http://www.stylusstudio.com/xslt_designer.html

I code the XSLT myself using either
www.oxygenxml.com or www.stylusstudio.com

cheers

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now