V4 GetXmlDocumentByUrl fails when reading web service with xmlns data
I have created a simple web service that sends an arraylist of a data structure.
I can get this using GetXmlDocumentByUrl but cannot iterate through the collection. If I remove the generated xmlns statements manually everything works OK.. I have scanned the net and unable to find a simple way to remove these statements in the web service.
All you need is a little knowledge of namespaces - because of the last xmlns attribute in the XML you're transforming, the elements of the file exists in the http://tempuri.org-namespace, so you'll need to map the namespace-uri "http://tempuri.org/" to a prefix in your XSLT file and use that prefix on the elements you're selecting:
Add the namespace to the <xsl:stylesheet> instruction:
V4 GetXmlDocumentByUrl fails when reading web service with xmlns data
I have created a simple web service that sends an arraylist of a data structure.
I can get this using GetXmlDocumentByUrl but cannot iterate through the collection. If I remove the generated xmlns statements manually everything works OK.. I have scanned the net and unable to find a simple way to remove these statements in the web service.
Thanks for your help
Sample Xml Document
XSLT
Hi there,
All you need is a little knowledge of namespaces - because of the last xmlns attribute in the XML you're transforming, the elements of the file exists in the http://tempuri.org-namespace, so you'll need to map the namespace-uri "http://tempuri.org/" to a prefix in your XSLT file and use that prefix on the elements you're selecting:
Add the namespace to the <xsl:stylesheet> instruction:
and then prefix the elements you're selecting:
/Chriztian
Well many thanks Chriztian, this all works fine now. Your prompt reply has really helped me out.. Hope I can return the favour some time
Digby
is working on a reply...