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

RE: Transform XML

Subject: RE: Transform XML
From: "Bryan Archer" <barcher@xxxxxx>
Date: Wed, 30 Apr 2003 16:55:41 +0100
bryan archer
Just write xml tags as you would html tags, there is no difference.
Either do this literally or using <xsl:element>

i.e.

<xsl:template match="foo">
	<fld name="{MyValue}" />

      <!-- or -->

      <xsl:element name="fld"> 
        <xsl:attribute name="name"><xsl:value-of select="MyValue" /></xsl:attribute>
      </xsl:element>
</xsl:template>


-----Original Message-----
From: Karl J. Stubsjoen [mailto:karl@xxxxxxxxxxxxx]
Sent: 30 April 2003 15:59
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  Transform XML


Hello, I need to take the following XML and transform it into something
quite simpler, this might be the result:

<?xml version="1.0">
<FLDS>
    <FLD name="orig_fld_name"/>
    <FLD name="orig_fld_name"/>
    <FLD name="orig_fld_name"/>
    <FLD name="orig_fld_name"/>
    ...
</FLDS>

Now, I get how to loop through the following XML, and all that jazz... but I
need help setting up the template so that I can write back XML.  As in:  how
do you write XML tags (nodes), can you prefix them?  I have set the XSL
output to "XML", is there some sort of copy command.
Thanks!
Karl

What I have to work with is a persisted ADOXML Recordset, and it looks like
this:

- <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882"
xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
- <s:Schema id="RowsetSchema">
- <s:ElementType name="row" content="eltOnly" rs:CommandTimeout="30">
- <s:AttributeType name="usr_memberID" rs:number="1" rs:nullable="true"
rs:writeunknown="true">
  <s:datatype dt:type="int" dt:maxLength="4" rs:precision="4"
rs:fixedlength="true" />
  </s:AttributeType>
- <s:AttributeType name="usr_UID" rs:number="2" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="USR_PWD" rs:number="3" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="fname" rs:number="4" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="lname" rs:number="5" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="email" rs:number="6" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="email2" rs:number="7" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="email3" rs:number="8" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="phone_home" rs:number="9" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="phone_cell" rs:number="10" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="phone_fax" rs:number="11" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="phone_other" rs:number="12" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="address1" rs:number="13" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="address2" rs:number="14" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="city" rs:number="15" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="state" rs:number="16" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:fixedlength="true" rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="zip" rs:number="17" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="notes" rs:number="18" rs:writeunknown="true">
  <s:datatype dt:type="string" rs:dbtype="str" dt:maxLength="4294967295"
rs:maybenull="false" />
  </s:AttributeType>
- <s:AttributeType name="Hire_Date" rs:number="19" rs:nullable="true"
rs:writeunknown="true">
  <s:datatype dt:type="date" dt:maxLength="6" rs:fixedlength="true" />
  </s:AttributeType>
- <s:AttributeType name="Termination_Date" rs:number="20" rs:nullable="true"
rs:writeunknown="true">
  <s:datatype dt:type="date" dt:maxLength="6" rs:fixedlength="true" />
  </s:AttributeType>
- <s:AttributeType name="DOB" rs:number="21" rs:nullable="true"
rs:writeunknown="true">
  <s:datatype dt:type="date" dt:maxLength="6" rs:fixedlength="true" />
  </s:AttributeType>
  <s:extends type="rs:rowbase" />
  </s:ElementType>
  </s:Schema>
  <rs:data />
  </xml>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
Visit our website at http://www.rm.com

This message is confidential.  You should not copy it
or disclose its contents to anyone.  You may use and apply the information
only for the intended purpose.  Internet communications are not secure and
therefore RM does not accept legal responsibility for the contents of this
message.  Any views or opinions presented are only those of the author and
not those of RM.  If this email has come to you in error please delete it
and any attachments.  Please note that RM may intercept incoming and
outgoing e-mail communications.

This email has been scanned for viruses by Trend ScanMail.

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


Current Thread
  • RE: Transform XML, (continued)
    • XSL Chatr - Wed, 30 Apr 2003 12:08:17 -0400 (EDT)
    • Bryan Archer - Wed, 30 Apr 2003 11:57:32 -0400 (EDT) <=
    • cknell - Wed, 30 Apr 2003 15:29:06 -0400 (EDT)
    • me - Wed, 30 Apr 2003 15:46:10 -0400 (EDT)
    • cknell - Wed, 30 Apr 2003 15:48:20 -0400 (EDT)

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.