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

xslt assistance please

Subject: xslt assistance please
From: "Azariah Jeyakumar" <azariah.jeyakumar@xxxxxxxxxxxxxx>
Date: Fri, 13 Oct 2000 11:24:18 -0700
xslt minoccurs
Hi,

Would someone help me get started with XSLT? I need to transform 1.xml to
2.xml.

Thanks a lot
Azariah

1.xml
--------

<root>

<AccountBaseDescriptorType>
  <element name="Name"       type="string"    minOccurs="0" />
  <element name="Medium"     type="string"    minOccurs="0" />
  <element name="Address"    type="string"    minOccurs="0" />
  <element name="Id"         type="Integer64" minOccurs="0" />
  <element name="remaining"  type="string"    minOccurs="0" />
</AccountBaseDescriptorType>

<AccountCreatableDescriptorType base="AccountBaseDescriptorType" >
  <mandatory>
    <Name/>
    <Address/>
  </mandatory>
  <prohibited>
    <Id/>
  </prohibited>
  <defaults>
    <Medium value="TW_MEDIUM_SMTP_HTTP"/>
  </defaults>
</AccountCreatableDescriptorType>

<AccountDescriptorType base="AccountBaseDescriptorType" >
  <mandatory fields="ALL">
  </mandatory>
</AccountDescriptorType>

</root>

2.xml
--------
<complexType name="AccountBaseDescriptorType">
  <all>
    <element name="Name"       type="string"    minOccurs=0 />
    <element name="Medium"     type="string"    minOccurs=0 />
    <element name="Address"    type="string"    minOccurs=0 />
    <element name="Id"         type="Integer64" minOccurs=0 />
    <element name="remaining"  type="string"    minOccurs=0 />
  </all>
</complexType>

<complexType name="AccountCreatableDescriptorType"
base="AccountBaseDescriptorType"
    derivedBy="restriction" >
  <all>
    <element name="Name"       type="string"    minOccurs=1 />
    <element name="Medium"     type="string"    use="default"
        value="TW_MEDIUM_SMTP_HTTP" />
    <element name="Address"    type="string"    minOccurs=1 />
    <element name="Id"         type="Integer64" minOccurs=0 maxOccurs=0 />
    <element name="remaining"  type="string"    minOccurs=0 />
  </all>
</complexType>

<complexType name="AccountDescriptorType" base="AccountBaseDescriptorType"
  derivedBy="restriction" >
  <all>
    <element name="Name"       type="string"    minOccurs=1 />
    <element name="Medium"     type="string"    minOccurs=1 />
    <element name="Address"    type="string"    minOccurs=1 />
    <element name="Id"         type="Integer64" minOccurs=1 />
    <element name="remaining"  type="string"    minOccurs=1 />
  </all>
</complexType>

PS1: My goal is to generate 2.xml. So, it is OK to restructure 1.xml to make
the transformation easier-to-write.
PS2: Performance is not a consideration for the transformation.
PS3: The element names "Account...DescriptorType" should not be hard-coded
in the .xsl file.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.