Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9128395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:30:15+00:00 2026-06-17T07:30:15+00:00

Given the following XML file: <packages> <package name=Library> <distributionPoints> <distributionPoint path=http://SERVER001/SMS_DP_SMSPKGD$/CEN0003B/ /> <distributionPoint path=http://SERVER002/SMS_DP_SMSPKGD$/CEN0003B/

  • 0

Given the following XML file:

 <packages>
 <package name="Library">
 <distributionPoints>
  <distributionPoint path="http://SERVER001/SMS_DP_SMSPKGD$/CEN0003B/" /> 
  <distributionPoint path="http://SERVER002/SMS_DP_SMSPKGD$/CEN0003B/" /> 
  </distributionPoints>

 <package name="SystemFiles">
 <distributionPoints>
  <distributionPoint path="http://SERVER001/SMS_DP_SMSPKGD$/CEN00262/" /> 
  <distributionPoint path="http://SERVER002/SMS_DP_SMSPKGD$/CEN00262/" /> 
  </distributionPoints>
  </package>
</packages>

I am calling the function below to retrieve the information from “SystemFiles” node:
“http://SERVER001/SMS_DP_SMSPKGD$/CEN00262/&#8221;
“http://SERVER002/SMS_DP_SMSPKGD$/CEN00262/&#8221;

I am able to retrieve the node “SystemFiles” but am having an issue trying to retrieve info from inside it. Here is my function:

Function GetDistributionPath(packageName)
  Dim foundPackageName
  foundPackageName = false

  Set objXml = CreateObject("Microsoft.XMLDOM")
  If objXml.Load("Package.xml") Then
     WScript.Echo "loaded successfully."
  Else
     WScript.Echo "I was not able to load XML doc Package.xml!"
     WScript.Quit(1)
  End If

  Set packageNodes = objXml.documentElement.SelectNodes("//package")

  For Each packageNode in packageNodes
    If Not IsNull(packageNode.getAttribute("name"))  Then
          name = packageNode.getAttribute("name")
    End If

    If name = packageName Then
       foundPackageName = true

       'Get the DistributionPoint Paths
       'THIS CODE BELOW IS NOT WORKING <===== 

       'Set distributionPointNodes = packageNode.SelectNodes("//distributionPoint")
       'For Each distributionPointNode in distributionPointNodes
       '    distributionPointName = distributionPointNode.getAttribute("path")
       '    WScript.Echo "path: " & distributionPointName
       'Next

       Exit For
    End If
  Next
  Set objXml = Nothing

  If Not foundPackageName Then
    WScript.Echo "I could not find package name " & packageName & " in Package.xml!"
    WScript.Quit(1)
  End If   
End Function

'Other approache did not work as well
'Set objNode = objXml.selectSingleNode("packages/package[@name='SystemFiles']")
'WScript.Echo "Path: " & objNode.getAttribute("path")
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:30:17+00:00Added an answer on June 17, 2026 at 7:30 am

    Your published .XML is not well-formed (missing </package>). You don’t say in what way the standard strategy:

      Dim oFS    : Set oFS  = CreateObject("Scripting.FileSystemObject")
      Dim sFSpec : sFSpec   = oFS.GetAbsolutePathName("..\data\01.xml")
      Dim oXML   : Set oXML = CreateObject("Msxml2.DOMDocument")
      oXML.setProperty "SelectionLanguage", "XPath"
      oXML.async = False
      oXML.load sFSpec
      If 0 = oXML.parseError Then
         WScript.Echo oXML.xml
         WScript.Echo "-----------------"
         Dim sXPath : sXPath    = "/packages/package[@name='SystemFiles']"
         Dim ndFnd  : Set ndFnd = oXML.selectSingleNode(sXPath)
         If ndFnd Is Nothing Then
            WScript.Echo sXPath, "not found"
         Else
            WScript.Echo ndFnd.nodeName, ndFnd.getAttribute("name")
            WScript.Echo "-----------------"
            sXPath = "distributionPoints/distributionPoint"
            Dim ndlPoint  : Set ndlPoint = ndFnd.SelectNodes(sXPath)
            If 0 < ndlPoint.length Then
               Dim ndPath
               For Each ndPath In ndlPoint
                   WScript.Echo ndPath.getAttribute("path")
               Next
            Else
               WScript.Echo sXPath, "not found"
            End If
         End If
      Else
         WScript.Echo oXML.parseError.reason
      End If
    

    output:

    <packages>
            <package name="Library">
                    <distributionPoints>
                            <distributionPoint path="http://SERVER001/SMS_DP_SMSPKGD$/CEN0003B/"/>
                            <distributionPoint path="http://SERVER002/SMS_DP_SMSPKGD$/CEN0003B/"/>
                    </distributionPoints>
            </package>
            <package name="SystemFiles">
                    <distributionPoints>
                            <distributionPoint path="http://SERVER001/SMS_DP_SMSPKGD$/CEN00262/"/>
                            <distributionPoint path="http://SERVER002/SMS_DP_SMSPKGD$/CEN00262/"/>
                    </distributionPoints>
            </package>
    </packages>
    
    -----------------
    package SystemFiles
    -----------------
    http://SERVER001/SMS_DP_SMSPKGD$/CEN00262/
    http://SERVER002/SMS_DP_SMSPKGD$/CEN00262/
    

    does not work for you. So you have to check for yourself, where your work-around leaves the path of virtue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following XML file: <?xml version=1.0 encoding=UTF-8?> <process name=TestSVG2 xmlns=http://www.example.org targetNamespace=http://www.example.org xmlns:xsd=http://www.w3.org/2001/XMLSchema> <sequence>
Given the following XML file: <?xml version=1.0 encoding=UTF-8?> <application name=foo> <movie name=tc english=tce.swf chinese=tcc.swf
Given the following XML file: <users> <user name=admin password=foobar roles=Admin,Guest /> <user name=guest password=foobar
Given the following XML section from a large xml file: <item id=C3DD6846593 > <name
Problem Given the following XML configuration file: <main> <name>JET</name> <maxInstances>5</maxInstances> <parameters> <a>1</a> <b> <b1>test1</b1>
Given the following XML file: <?xml version=1.0 encoding=utf-8?> <Wix xmlns=http://schemas.microsoft.com/wix/2006/wi> <Fragment> <DirectoryRef Id=INSTALLLOCATIONAGENT> <Component
Given the following xml: <!-- file.xml --> <video> <original_spoken_locale>en-US</original_spoken_locale> <another_tag>somevalue</another_tag> </video> What would be
Given the following: >>> from lxml import etree >>> contents=open('file.xml').read() >>> node=etree.fromstring(contents) How would
Given the following XML: <Contact> <ContactID>41111-f15a-4fa1-b643-47877608f557</ContactID> <ContactStatus>ACTIVE</ContactStatus> <Name>ABC Ltd</Name> <EmailAddress>xxx@xxx.co</EmailAddress> <SkypeUserName>xxxdemo</SkypeUserName> <Addresses> <Address> <AddressType>STREET</AddressType>
Given the following XML file, what do the DOCTYPE , ENTITY , SYSTEM ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.