xsl-list
[Top] [All Lists]

[xsl] Outputting a complete schema definition??

2006-07-12 08:05:41
Hi,

 I am new to XSL. Apologies if this is very basic question;

 At a high level I have an XML schema and an XML file. I want to
extract specific data from the XML file and add it to the
schema(extend the schema) using XSLT(dynamic schema extension to an
extent). Extracting the data from the XML file is ok, the problem I am
having is outputting all of the schema(i.e. all of the tags +
information) to my result file.

 E.g. XSD input file (sample)
 <schema>
 <schema xmlns = "http://www.w3.org/2001/XMLSchema";
 targetNamespace = "xxxxxxxxx"
 version = "3.5">
<include schemaLocation = "xxxxx"/>
<element name = "xxxxx">
 <annotation>
  <documentation>
                        Example of the information contained within the schema
 </documentation>
 </annotation>
 <complexType>
  <sequence>
   <element ref = "xxx" maxOccurs = "unbounded"/>
   <element ref = "xxx" minOccurs = "0"/>
  </sequence>
  <attribute name = "docId" use = "required" type = "string"/>
 </complexType>
</element>
 ....
 </schema>


 My XSL
 ======
 <?xml version="1.0" encoding="ISO-8859-1" ?>
<!--  Edited with XML Spy v2006 (http://www.altova.com) -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:x="http://www.ipdr.org/namespaces/IPDR";>
<xsl:output method="xml" omit-xml-declaration="no" version="1.0"
encoding="UTF-8" indent="yes" />  <xsl:template match="/">
 <xsl:apply-templates/>
</xsl:template>
<!-- Basic Template -->
<xsl:template match="x:schema">
 <xsl:apply-templates/>
</xsl:template>
<xsl:template match="x:element">
 <xsl:apply-templates/>
</xsl:template>
<xsl:template match="x:complexType">
 <xsl:text> Sample text </xsl:text>
 <xsl:value-of select="."/>
</xsl:template>
 ......
 </stylesheet>

 My output just prints the 'info' within the schema;

 'Example of the information contained within the schema'

 How do I get it to output all of the schema complete with all its
tags??? What function should I look at in order to do this?

 BR,
 Chris.

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>