April 28, 2008 at 8:43 pm #49994
I am trying to translate an XML message into HL7. I am getting the following error:
[0:TEST] Error generated during parsing. – Datatype error: Type:InvalidDatatypeValueException, Message:The unary operation node had a binary node type. – Line 1, Col 510
Can anyone tell me what this means?
Thanks in advance….
April 29, 2008 at 10:50 am #64425
XML can be finicky at best… Not sure if I can answer your question as to what the error means (other than it appears that the data that is coming in an associated tag does not match the datatype of the tag)…
With that said… I generally just use string as the datatype for every tag…
Though this may not be ideal, it has worked in my very limited use of XML through the engine and generally once converted to format needed, the original datatype is not important anyway.
Not sure if that helps, but if you change a block of tags (saving out your original) you may be able to find the culprit by process of elimination.
April 29, 2008 at 11:05 am #64426
Thanks Ryan…I will try that out and see what happens and let you know.
April 29, 2008 at 12:17 pm #64427Robert MilfajtParticipant
For your XML, what type of encoding are you using. I had a problem going from HL7->XML because there were control characters in the HL7 that were not acceptable to the default XML encoding type, utf-8, but when I changed it to iso-8859-1, everything was fine.
Hope this helps,
April 29, 2008 at 12:23 pm #64428
I am using the utf-8, I will try converting it to your suggestion and see what happens….thanks.
April 29, 2008 at 12:56 pm #64429
Well I changed it to iso-8859-1 and am still getting the same error. I wish I knew what the error meant. But thanks for all the suggestions.
April 29, 2008 at 3:25 pm #64430
It means that the XML parser thought that it was performing an operation that would be using a single node and got a node that was a multiple. What the nodes were is the big question.
The way the XML specs talk about ‘nodes’ is a pain; your “unary operation node” is a great example. EVERYthing is a node. You’d think that humans had nothing better to do than parse XML and keep track of where they are in some abstract syntax tree. It appears that something was being parsed that resulted in the parser expecting some ‘single node’ (maybe a tag without attributes) but it got a tree of some sort instead.
I’d try to go out to character 510 of the input file and figure out what the parser thinks it’s looking at at that point.
What Cloverleaf version are you working with?
April 29, 2008 at 4:09 pm #64431
We are on 5.4.1. How do you count the columns in XML? Is it the actual data or does it include the tags?
April 29, 2008 at 5:42 pm #64432
Caveat: I haven’t worked with the Cloverleaf XML yet, and I don’t have access to a 5.4x system. That said… I’d count characters, especially since it’s the first line. My guess would be “first line” means “first line after the root element”.
I’d almost bet there is an extraneous ‘<' character in your input. That could cause the kind of parser error you're seeing. If the lexer reports that a tag is opening, and the parser is a validating parser, it's possible that the parser would decide there was an extra node where none was expected. Also, I just noticed this thread:
http://clovertech.infor.com/viewtopic.php?t=2498http://clovertech.infor.com/viewtopic.php?t=2498 ” class=”bbcode_url”>
From what Charlie says the error is coming from the schema, so you can find out what the parser was expecting by counting into the schema, but you’ll have to eyeball the input to find the bad data. I’d still guess it’s an “un-entified” less-than, though.
April 29, 2008 at 7:01 pm #64433
I am using XMLSpy and it has validated my schema. I changed everything to ENGINE=”xs:string” and that took care of that error. Now I am getting:
Element “OrderingPhysicianID” is not valid for content model: ”((AppointmentID,Patient,TechnologistID,Technologist,StressorID,Stressor,OrderingPhysicianID,OrderingPhysician,ReferringID,Referring,ReadingPhysicianID,ReadingPhysician,Date_x0020_Of_x0020_Test,Location,Status,NoShow,TestType),ReferringPhysicianID)’ – Line 1, Col 711
This is never ending….and why is everyone in such a hurry to implement XML?
April 29, 2008 at 7:39 pm #64434
I am including my schema in case you want to take a look. I had to change the ext to .txt, but it should be .xsd
April 29, 2008 at 8:01 pm #64435
The next thing to look for is to make sure that your data is consistant with your schema, Check your data file to make sure that every tag is present and that it is in the correct order with correct spelling… One thing I have done to make it a little more functional and error resistant is to add minOccurs=0 to the tag defininition… This won’t fix wrong order, but if a tag is missing as some apps will not send an empty tag.
check out this website for more details… I have found it to be very helpful.
April 29, 2008 at 8:04 pm #64436
C’mon now…XML is much better than … um … . . . X12 maybe? 🙄
I see that the type for CPI is unsignedInt, not string, so you might want to look at that in a bit.
The schema shows that the spGetCardioSchedule element is expecting a sequence of tags. If my memory serves me correctly it wants all of those tags in the order specified with none of them missing (I’ll be checking this and get back with the answer, but I think that’s what the xsd means.)
Is the OrderingPhysicianID element in the wrong position?
April 29, 2008 at 8:15 pm #64437
Thanks to both of you. I didn’t catch the CPI type, but will correct it now. So the data must be in the same order that the elements are. The data I am using is actually from an hl7 message that I did a translation on with this schema. It produces the xml file, but I can’t get it to go the other way and create an hl7 message.
Ryan, where are you located now? I haven’t talked to you since you left LabCorp…..
April 29, 2008 at 8:25 pm #64438
Not necessarily–you can make XMLschema allow it in any order but I think you lose the ability to prevent duplicate tags, your spGetPersons element ought to work that way.
sigh. I have barely worked with XMLSchema (I use RelaxNG and DTDs mostly) and its been more than a year since I did anything serious with XML. I’m getting tired of saying “I seem to recall” and “I’m pretty sure that”–I guess it’s time to brush up on W3C-ish stuff.
May 8, 2008 at 1:53 pm #64439Art SchwartzParticipant
II am seeing the following error message when trying to compile an XML to HL7 Xlate
Command: hcixlttest cardiodx_idxrad_oru.xlt
[0:TEST] Error loading XML Definition. – Unable to resolve the namespace of root element – ns1:ChlXmlExport
[0:TEST] Can’t get record definition for ‘xml Cardio ChlXmlExport ns1:ChlXmlExport’.
[0:TEST] Unable to compile XLT ‘cardiodx_idxrad_oru.xlt’.
The frustrating part of this is that the exact same schema is used in the HL7 to XML Xlate that is other half of this bi-directional interface and it compiles cleanly. Is CL more fussy on inbound XML then it is on Outbound XML?
I suspect that when I am using the XML package manager I am not choosing the correct option in the namespace and/or options panels
Any help would be appreciated
May 8, 2008 at 1:59 pm #64440
I am sure there may be a better way to do this, so others, please feel free to respond…
But in the meantime… one thing that I have done is make sure that my root tag looks like the following
as the first three lines… seems to load up ok..
- The forum ‘Cloverleaf’ is closed to new topics and replies.