Click here to Skip to main content
14,634,961 members
Home » Discussions » XML / XSL
   

XML / XSL

 
AnswerRe: '_Chairs' is an unexpected token. The expected token is '='. Line 1, position 545. Pin
Richard MacCutchan16-Nov-09 0:17
mveRichard MacCutchan16-Nov-09 0:17 
GeneralRe: '_Chairs' is an unexpected token. The expected token is '='. Line 1, position 545. Pin
Vimalsoft(Pty) Ltd16-Nov-09 0:22
professionalVimalsoft(Pty) Ltd16-Nov-09 0:22 
QuestionXQuery / multiple conditions Pin
pedefetoll15-Nov-09 23:19
Memberpedefetoll15-Nov-09 23:19 
QuestionXml to RDBMS table data transgformation Pin
rishi saraf13-Nov-09 1:53
Memberrishi saraf13-Nov-09 1:53 
QuestionSpace in attribute name Pin
Anir19829-Nov-09 20:59
MemberAnir19829-Nov-09 20:59 
AnswerRe: Space in attribute name Pin
Stuart Dootson9-Nov-09 23:01
professionalStuart Dootson9-Nov-09 23:01 
AnswerRe: Space in attribute name Pin
tassilo10-Nov-09 23:06
Membertassilo10-Nov-09 23:06 
QuestionHow can I traverse and read values in an XML using VBScript? Pin
Curtis Rowell6-Nov-09 1:03
MemberCurtis Rowell6-Nov-09 1:03 
Given the xml snippet below, I am trying to read the Company value. I have other code which will obtain the Network Policy Zone and the Default Gateway of a given system. Using these two values, zone first, then dfgw, I need to get the Company value which correspondes so it can be set as an environment variable in a remote windows system.

Here's my mess of code, and I'm afraid it is a mess because I've been trying different things:

Sub ReadXML()
	Dim attrValue, child1, child2, gChild1
	getZone()
	WScript.Echo "Zone is: " & zone
		
	Set xDoc = CreateObject("Microsoft.XMLDOM")  'CreateObject("Msxml.DOMDocument") CreateObject("Microsoft.XMLDOM") 
	xDoc.async = False
	xDoc.load ("company.xml")  'Load XML document
	Set Root = xDoc.documentElement
	Set NodeList = Root.getElementsByTagName(zone)
	
	Set child1 = xDoc.documentElement.firstChild 
	Set child2 = child1.nextSibling 
	Set gChild1 = child1.firstChild
	
	Do Until attrValue <> dfgw
	attrValue  = xDoc.GetAttrValue("DFGW")
	WScript.Echo("DFGW Attribute Value is: " & attrValue)
	xDoc.nextSibling
	Loop
	
	company = gChild1.nodeValue("Company")
	WScript.Echo("Company Attribute Value is: " & attrValue)
	
	
	'Set ElemList = xDoc.getElementsByTagName("Zone0")
	'dfgw = ElemList.item(0).getAttribute("DFGW")
	
	WScript.Echo("Default Gateway: " & dfgw)
	'company = "BMC Software, Inc."
	SetCompany(company)
		
End Sub



Here's the XML I'm trying to read:

<br />
  <?xml version="1.0" ?> <br />
- <ZoneList><br />
- <Zone0><br />
- <DFGW><br />
  "192.168.25.1" <br />
  <Company>"CPC"</Company> <br />
  </DFGW><br />
- <DFGW><br />
  "142.101.230.1" <br />
  <Company>"Test Company"</Company> <br />
  </DFGW><br />
- <DFGW><br />
  "" <br />
  <Company>""</Company> <br />
  </DFGW><br />
- <DFGW><br />
  "" <br />
  <Company>""</Company> <br />
  </DFGW><br />
- <DFGW><br />
  "" <br />
  <Company>""</Company> <br />
  </DFGW><br />
  </Zone0><br />
- <Zone1><br />

AnswerRe: How can I traverse and read values in an XML using VBScript? Pin
Stuart Dootson9-Nov-09 4:08
professionalStuart Dootson9-Nov-09 4:08 
QuestionXml File Problems Pin
md_refay4-Nov-09 4:19
Membermd_refay4-Nov-09 4:19 
AnswerRe: Xml File Problems Pin
The Man from U.N.C.L.E.11-Nov-09 11:45
MemberThe Man from U.N.C.L.E.11-Nov-09 11:45 
QuestionXSD Unique Implementation and XPath Pin
Skippums2-Nov-09 12:33
MemberSkippums2-Nov-09 12:33 
AnswerRe: XSD Unique Implementation and XPath Pin
Christian Graus3-Nov-09 11:27
mveChristian Graus3-Nov-09 11:27 
AnswerRe: XSD Unique Implementation and XPath Pin
Stuart Dootson3-Nov-09 22:54
professionalStuart Dootson3-Nov-09 22:54 
GeneralRe: XSD Unique Implementation and XPath Pin
Skippums4-Nov-09 2:28
MemberSkippums4-Nov-09 2:28 
GeneralRe: XSD Unique Implementation and XPath Pin
Stuart Dootson4-Nov-09 2:52
professionalStuart Dootson4-Nov-09 2:52 
QuestionSorted xml element while serialising Pin
Soundman32.22-Nov-09 1:28
MemberSoundman32.22-Nov-09 1:28 
AnswerRe: Sorted xml element while serialising Pin
Soundman32.22-Nov-09 3:58
MemberSoundman32.22-Nov-09 3:58 
Questionattribute centric Pin
Michael A. Klausmeyer1-Nov-09 8:27
MemberMichael A. Klausmeyer1-Nov-09 8:27 
QuestionHow to Password Protect a XML SpreadSheet Pin
ANSHUMAN44429-Oct-09 5:14
MemberANSHUMAN44429-Oct-09 5:14 
AnswerRe: How to Password Protect a XML SpreadSheet Pin
Christian Graus1-Nov-09 9:30
mveChristian Graus1-Nov-09 9:30 
QuestionC# XML datagridview delete row Pin
Wheels01227-Oct-09 3:38
MemberWheels01227-Oct-09 3:38 
QuestionC# Append XML File Pin
Wheels01223-Oct-09 5:42
MemberWheels01223-Oct-09 5:42 
AnswerRe: C# Append XML File Pin
Christian Graus23-Oct-09 10:35
mveChristian Graus23-Oct-09 10:35 
GeneralRe: C# Append XML File Pin
Wheels01226-Oct-09 1:24
MemberWheels01226-Oct-09 1:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.