Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a tool that programmatically invokes stsadm.exe and parses the results. The output looks like XML, so I've been using an XML parser to read it. One of my customers ran my tool on a French MOSS installation, and the XML parse fails. Sure enough, if you run "stsadm -o enumzoneurls" from the command line, you get this:

<ZoneUrls> 
  <Collection Name="Administration centrale"> 
    <Par défaut>http://machine:7955</Par défaut> 
  </Collection> 
  <Collection Name="SharePoint - 38089"> 
    <Par défaut>http://machine:38089</Par défaut>
  </Collection> 
  <Collection Name="SharePoint - 80"> 
    <Par défaut>http://machine</Par défaut> 
  </Collection> 
</ZoneUrls>

Tag names are not allowed to have spaces in them, so this is not legal XML. At this point I question my assumption that stsadm returns XML, and try to find some sort of guarantee. I can't find any documentation about the output of stsadm at all (e.g. here).

So I guess my questions are: does anyone know of any documentation on the output of stsadm? What are your strategies for handling non-English installations?

share|improve this question

1 Answer 1

How interesting! Test this running the latest service pack and cumulative updates. If it still occurs it is obviously a bug that you should report to Microsoft.

In the meantime your best option is to correct the output from stsadm using a simple string replace before attempting to parse it as XML.

share|improve this answer
    
This is at a customer's site, so we can't really experiment with upgrading. And doing string replacement could work in this specific case, but the larger problem is the lack of documentation. Even ignoring the space in the tags, I'm now concerned about doing any sort of XPath query on the document. I'm still curious about the format of the output, but I had been planning on changing my app to not call stsadm and instead go through the OM. This just gave me another reason to make the change. –  bmm6o Feb 24 '10 at 16:55

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.