3.2.0

Take tag attributes as columns

Hi, i want use a ADODB.RecordSet(RS) as Table datasource, one of RS methods retrieve data as XML, but, the name fields are into z:row. the XML Format 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='c0' rs:name='' rs:number='1' rs:nullable='true'><s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='13'/></s:AttributeType><s:extends type='rs:rowbase'/></s:ElementType></s:Schema><rs:data><z:row c0='ASA00032531A'/></rs:data></xml>


I read the documentation and i understand (i guess) my XML should be like this:

<data>
<row>
<c0>ASA00032531A</c0>
<row>
</rs:data>


but i want use the original XML returned by RS

can you help me?

thanks
Arturo Guerrero
September 1,
Here Alex explains how to do that with a attribute-based xml file..

http://www.activewidgets.com/javascript.forum.6195.4/xml-data-load.html

BUT, I have been try with a ADO persisted XML file, just like yours and I haven´t good results.. Anyway.. I transformed the file into an element based using making and using this XSLT file...

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" />
<xsl:preserve-space elements="*"/>

<xsl:template match="node( ) | @*">
<xsl:copy>
<xsl:for-each select="rs:data">
<xsl:apply-templates select="z:row"/>
</xsl:for-each>
<xsl:apply-templates select="s:Schema"/>
</xsl:copy>
</xsl:template>

<xsl:template match="s:Schema">
<xsl:for-each select="s:ElementType">
<xsl:apply-templates select="s:AttributeType"/>
</xsl:for-each>
</xsl:template>


<xsl:template match="z:row/@*">
<xsl:element name="{name( )}">
<xsl:value-of select="." />
</xsl:element>
</xsl:template>

<xsl:template match="z:row">
<xsl:element name="R">
<xsl:apply-templates select="@*"/>
</xsl:element>
</xsl:template>

<xsl:template match="s:AttributeType">
<xsl:element name="c">
<xsl:attribute name="tipo">
<xsl:value-of select="s:datatype/@dt:type"/>
</xsl:attribute>
<xsl:value-of select="@name"/>
</xsl:element>
</xsl:template>

</xsl:stylesheet>

As you can see... I put all data fields just at the EOF, that´s cause the number and nature of data fields, in my case, are completelly variable.. Anyway you can remove this especification if you want. Once you convert your ADO persisted xml file (using the server tech for DOM interface you want).. you can simply load this element-based xml into a ActiveWidgets grid..

That works for me...

Raciel R.L.
February 14,
Finally, the solution:

http://www.activewidgets.com/javascript.forum.6195.5/xml-data-load.html
Raciel R.L.
February 14,

This topic is archived.

See also:


Back to support forum