$url = "abc.domain.com"
$textboxTenantName.Text = ($file.SelectSingleNode("//Instance[BindingHostName='$url']").Name)
I use this code to look up a node in an XML file that is equal to ABC.domain.com. NOTE: in $URL the full hostname is in lowercase. However, in the SelectSingleNode the BindingHostName could be partially in uppercase, which poses a problem when you don't know what case it is to begin with.
How can I make the $textboxTenantName.Text = 'abc.domain.com' when the BindingHostName is ABC.domain.com?
I hope i explained what I am looking to do clearly. If not, please ask any questions.
Thank you,
Mike
XML and case sensitivity
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: XML and case sensitivity
There are numerous examples of ways t do this here:
https://www.google.com/search?newwindow ... Pq9XJwkGiA
https://www.google.com/search?newwindow ... Pq9XJwkGiA
- mtartaglia
- Posts: 101
- Last visit: Mon Dec 19, 2022 11:45 am
Re: XML and case sensitivity
Yea, I have used Google prior to posting here as I always do. I was hoping someone could just give me something that could help with my specific code in this forum to save me a little time and maybe help others looking for a similar solution.
- mtartaglia
- Posts: 101
- Last visit: Mon Dec 19, 2022 11:45 am
Re: XML and case sensitivity
I don't think its going to work, but I had another though.
I am researching on how to search an XML file for the node BindingHostName and change the value or that node to all lowercase. I would imagine this may be simpler for what I am trying to accomplish. Any guidance on this would be appreciated.
The steps would be
1. Search each node of BindingHostName
2. convert each node's value to all lowercase
3. Save XML file
I am researching on how to search an XML file for the node BindingHostName and change the value or that node to all lowercase. I would imagine this may be simpler for what I am trying to accomplish. Any guidance on this would be appreciated.
The steps would be
1. Search each node of BindingHostName
2. convert each node's value to all lowercase
3. Save XML file