Jump to content

use XML with XML Response of a web service


Recommended Posts

Hi, Im new with LabVIEW, and i have a problem using the web services. I want to have more information with the response of the web service, so I use XML to format the output (with "flatten to XML").

The problem is that i want to recieve the response in XML, and when i recieve the response, the symbols < and > of my XML tags had been modified.

For example, i want to recieve some code like this:

<Response>

<Terminal>

<Name>

example

</Name>

<Value>

<String>

<Val>

Example text

</Val>

</String>

</Value>

</Terminal>

</Response>

but i receive this:

<Response>

<Terminal>

<Name>

example

</Name>

<Value>

<String>

<Val>

Example text

</Val>

</String>

</Value>

</Terminal>

</Response>

PS: Sorry for my english it is very poor.

Link to comment

The idea is to use the web service with ajax, so i can parse the xml to load the result of the operation, so i can't use this solution. Can I configure the LabVIEW's response not to change that escapes characteres? or any similar solution?

thanks for all responses.

Link to comment

You should not be seeing the & replacements when calling the web service. Try calling it from IE or Firefox and see if you still get them. I don't with any of my web services. This could be a problem with the tool you are using to call the web service and not LabVIEW.

Any decent XML parser should know to convert < to a < character.

Link to comment

I'm using Firefox. I configure the output of the web service like a XML file, and I receive it well in my browser, but when I add some XML additional tags, the special characters of those tags were changed, so when i try to parse the XML response with javascript, it didn't recognize the < character like the < character.

Link to comment

I'm using Firefox. I configure the output of the web service like a XML file, and I receive it well in my browser, but when I add some XML additional tags, the special characters of those tags were changed, so when i try to parse the XML response with javascript, it didn't recognize the < character like the < character.

Use the javascript "html_entity_decode" function.

html_entity_decode(string)

Normal chars will remain unaffected but   &alt etc will be converted.

Damn. Now I'm a text heretic biggrin.gif

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.