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

RE: Building XML DOM from Access DB column with mixed

Subject: RE: Building XML DOM from Access DB column with mixed content
From: "Chris Bayes" <chris@xxxxxxxxxxx>
Date: Tue, 13 Nov 2001 17:41:59 -0000
parse column content access
Doug,
You would have to do something like
Set newElem = gobjXML.createElement("definition")
Dim xml:set xml = server.createobject("msxml2.domdocument")
xml.loadXML("<?xml version=""1.0""?><t>" & objRS("Definition") & "</t>")
Dim nodes:set nodes = xml.selectNodes("/t/*")
For n in nodes
	newElem.appendChild n
Next
root.childNodes.Item(i).appendChild newElem

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Doug Howell
> Sent: 13 November 2001 16:38
> To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Building XML DOM from Access DB column with 
> mixed content
> 
> 
> Do any of you have any direction for me on this problem:
> 
> 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
> 
> 


 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.