⎕XML does not like <?xml - should it???

General APL language issues

⎕XML does not like <?xml - should it???

Postby MBaas on Wed Feb 29, 2012 7:06 pm

A standard tag such as
Code: Select all
<?xml version="1.0" ?>

causes an error "XML error at start of text - orphaned data" - I'm just wondering if that initial tag shouldn't be supported when processing apl-to-array...
User avatar
MBaas
 
Posts: 156
Joined: Thu Oct 16, 2008 1:17 am
Location: Gründau / Germany

Re: ⎕XML does not like <?xml - should it???

Postby Richard|Dyalog on Thu Mar 01, 2012 10:53 am

You are correct; that is expected to work. The message indicates that ⎕XML believes that the first element of the right argument character vector is neither a space or '<'. You could establish whether this is the case by passing your XML text to ⎕UCS and checking that you get 60 as the first element in the result.

If you are reading the XML from a file using ⎕NREAD etc, it is possible there may have been a Byte Order Mark (BOM) at the start of the file which you have imported.

If ⎕UCS either does show the expected 60 in the first element, or does not and it is not clear why, then please send me a workspace via Support and I'll see if I can determine what's going on for you.
User avatar
Richard|Dyalog
 
Posts: 44
Joined: Thu Oct 02, 2008 11:11 am

Re: ⎕XML does not like <?xml - should it???

Postby MBaas on Thu Mar 01, 2012 5:34 pm

Thanks Richard. After some more hours of development my latest xml-files are created differently and ⎕XML behaves correctly now ;-)
User avatar
MBaas
 
Posts: 156
Joined: Thu Oct 16, 2008 1:17 am
Location: Gründau / Germany


Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest