[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Outputting a complete schema definition??

Subject: Outputting a complete schema definition??
From: "Christopher Foley" <ccfoley@xxxxxxxxx>
Date: Wed, 12 Jul 2006 16:05:16 +0100
christopher foley
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.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.