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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get Name of xsl:variable in VB

Status
Not open for further replies.

bbuk

Technical User
Apr 27, 2002
44
0
0
GB
Hi
I am just dipping into xml for one project so I hope an expert here can help me. I need to produce a VB6 prog to edit an existing .xsl file, which is part of a much bigger project, allowing the user to input his address details. The xsl file consists of many lines of comment then the active lines like:

<xsl:variable name=&quot;Address1&quot;>1</xsl:variable>

I want to replace the 1 with a cdata statement that the user enters. So far so good. My problem is that I can read the value of each variable using MSXML.DOMDocument, but I cannot read the variable name - i.e. &quot;address1&quot; , &quot;address2&quot; etc.

Any suggestions welcome - I'm sure I am missing something very obvious :)

 
I think you have.. the variable's address1 value is actually stored as an attribute. The attributes identifier is, er, name :) You should be able to retrieve the attribute from the variable node in the same way you retrieve any attribute from any xml node.

MSXML.DOMDocument has some functions that allow you to get the attributes from the xml document. Look them up in MSDN





matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top