Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ADO xml transforming using XSL

Status
Not open for further replies.

chigley

Programmer
Sep 30, 2002
104
GB
I am new to XML. I have created an XML file from an ADO recordset, and an XSL file to transform it, and am using vbscript to use the MSXMLDOM object to do the transforming. I have two templates in the XSL file match="/" and match="z:row". The root template produces the header output fine, but hte z:row match does nothing.

I have been reading solidly for 3 days now, and cannot see what I am doing wrong. I have also found example code on the web, that strongly resembles what I am trying to do. Can someone give me an example of an XSL file that transforms all z:rows of an ADO generated XML file to HTML text fields, setting the value of the text field to the value of the z:row first field?

Thanks in advance

Charlie
 
One final thing before I can put this to bed. I have the xml formatted correctly apart from the header >>>

<TransferSet schemename="NICEIC" email="not_yet_known@niceic.com" password="kapwkp1" website=" xmlns:z="#RowsetSchema">
<SchemeScope scope="Full" scopedefinition="partp" processinginstruction="deleteall">
<Company companyname="P D Electrics" schemenumber="D102006 " addressl1="133 Newark Avenue" addressl2="" addressl3="" town="Peterborough" county="" postcpde="PE1 4NL" phone1="01733 343 103" phone2="" website="" email="" mode="insert" />
<Company companyname="Chris Saich Electrical Services" schemenumber="D102981 " addressl1="Elmet Cottage" addressl2="Church Lane" addressl3="Brimpton" town="Reading" county="" postcpde="RG7 4TJ" phone1="01189 712815" phone2="" website="" email="" mode="insert" />

Need to remove xmlns:z="#RowsetSchema" from the TransferSet tag. Have added the following to the XSL

<xsl:eek:utput method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>

but still no joy. Any ideas?
 
tsuji,

that's just the steer I needed thanks. For future readers of this threaad, I was using the exclude-result-prefixes attribute (albeit I didn't know what it did until you pointed it out :) ), and faced the problem of needing to exclude more than one namespace. This is achieved thusly :

exclude-result-prefixes="rs z">

where the list of namespaces to be excluded is a space delimeted list.

Once again thanks for all your help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top