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:

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

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?


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.

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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