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

Building/transforming XML on server from DB column wit

Subject: Building/transforming XML on server from DB column with mixed content
From: "Doug Howell" <doug@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 9 Nov 2001 10:37:29 -0500
building asp page from db
Hi, everybody,

I have a glossary.xml file which I've been parsing and transforming on the
IE 5 client. Now, for a test, I'm implementing it via an ASP page, parsing
and transforming on the server, and storing the glossary in an Access
database. I'm building a DOM, transforming it, then including the string
result into the document. I've got the mechanics of it working, but I've run
into a problem. If one of you could steer me in the right direction, I'd
really appreciate it.

I'm storing several of the XML elements in their own columns in the Access
DB ("term," etc.). The trouble is that the "definition" element has child
elements which I'm not breaking out into their own columns. In other words,
the Definition field in my DB has child elements (such as "<em>," "<uri>,"
etc.) within it, as well as entity references. This means that when I create
a "definition" element from the Definition field, the embedded child
elements and entity references are not parsed like they were in my XML file,
but are treated like text.

Is there a way to parse the contents of the Definition field "on its way" to
the DOM document, so these elements/entity refs will be transformed
correctly to the HTML output?

Thanks,
Doug Howell

Here's part of the code: (I'm using MSXML3 SP1)

<%
'create XML doc from SQL results
dim root
dim entry
dim newElem
dim newAttrib
dim i

Set root = gobjXML.documentElement

i = 0
While Not objRS.EOF
 Set newElem = gobjXML.createElement("entry") 'create a new entry
 root.appendChild newElem
 Set newElem = gobjXML.createElement("term") 'create the term element
 root.childNodes.Item(i).appendChild newElem
 root.childNodes.Item(i).lastChild.Text = objRS("Term")
 Set newElem = gobjXML.createElement("definition")
 root.childNodes.Item(i).appendChild newElem
 root.childNodes.Item(i).lastChild.Text = objRS("Definition")
 i = i + 1
 objRS.MoveNext
Wend
objRS.close
objConn.close
Set objRS = Nothing
Set objConn = Nothing
'do the transformation and write the results into the page below
strResult = gobjXML.transformNode(gobjXSL)

%>




 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.