LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

BOM

Is there a way to handle BOM (byte order mark) in XML?

 

 

George Zou
0 Kudos
Message 1 of 6
(3,411 Views)

Hi Zou,

 

Could you be a little more specific. What exaclty do you want to accomplish. You can find a lot of information on BOM in XML and that is not something necessarily specific to any of our products.

 

Regards,
Basil
Applications Engineering
National Instruments
0 Kudos
Message 2 of 6
(3,368 Views)

I want detect BOM, and process the xml string accordingly.

 

> You can find a lot of information on BOM in XML and that is not something necessarily specific to any of our products.

Is that means CVI XML functions can't not handle BOM?

 

 

 

George Zou
0 Kudos
Message 3 of 6
(3,359 Views)

Hi Zou,

 

I don't know that LabWindows/CVI has any native functions that detect this. However, if it's saved as ASCII then it will show the encoding type at the very top. BOM is more for transferring XML text between XML parsers, not for a particular C editor.

 

Regards,
Basil
Applications Engineering
National Instruments
0 Kudos
Message 4 of 6
(3,347 Views)

I'm building a dll, which takes an xml input.

The caller is in unicode.

The xml string might have the BOM.

The xml string is parsered in CVI with XML function.

I have to handle the BOM in CVI.

 

 

George Zou
0 Kudos
Message 5 of 6
(3,345 Views)

Hi Zou,

 

You can write your own code to detect and parse accordingly. There are a lot of examples of this online http://www.xponentsoftware.com/Articles/Byte_order_mark.aspx

 

We also have a set of functions in the Programmers Toolbox under Libraries that might be of use to you. From what I've seen none of them is explicitly a function that tells you what kind of encoding an XML file has but nonetheless they are probably still useful. Go to Libraries>>Programmers Toolbox>>Endianess

 

Hope this helps,

 

Regards,
Basil
Applications Engineering
National Instruments
0 Kudos
Message 6 of 6
(3,328 Views)