Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

parse flux xml

i have a file
i transform this file in xml file
with tFileinputFullRow + tJavaRow
it's ok
now i would like extract a attribut of a element
i want to use tparseXMLrow
but i have a exception in component tParseXMLRow_1
org.dom4j.DocumentException: Error on line 1 of document : XML document structures must start and end within the same entity. Nested exception: XML document structures must start and end within the same entity.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.dom4j.io.SAXReader.read(SAXReader.java:365)
at talenddemosjava.xmltovtg_0_1.xmltovtg.tMysqlInput_1Process(xmltovtg.java:575)
how do i make ?
thank a lot for your help !
xml structure is
<A>
<B>
</B>
<C>
<data ct="hhh" ></data>
<data ct="hhh" ></data>
</C>
</A>
Labels (4)
15 Replies
Anonymous
Not applicable
Author

Hi,
if you take a look at the error message you could find the solution: Your xml must start end end with the same tag. So you should add a opening tag at the start "<data>" for example and a closing one at the end "</data>" in this case.
Additional you should add a header in the first line like the following:
<?xml version="1.0" encoding="iso-8859-1"?>
You could find more information for example on: Wikipedia.
Bye
Volker
Anonymous
Not applicable
Author

hi,
i verif structure of my xml message
it is good
but i have always Exception in component tParseXMLRow_1
org.dom4j.DocumentException: Error on line 1 of document : XML document structures must start and end within the same entity. Nested exception: XML document structures must start and end within the same entity.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.dom4j.io.SAXReader.read(SAXReader.java:365)
at talenddemosjava.v1toxml_0_1.v1toxml.tFileInputFullRow_1Process(v1toxml.java:1356)
i think that the flux xml it isn't in one row but in several rows
when tParseXMLRow_1 parse the first row i see the start entity but i don't see the end entity because the end entity is on another row
do i make concat each row in one row ?
or is it a mistake to think that ?
thank for your help !
Anonymous
Not applicable
Author

hi,
XML document structures must start and end within the same entity

looks like a error xml structure ... Did your root Element are closed "at the end" !?
<myroot>
<other>....</other>
</myroot>

You can check your file by open it in Firefox to point the error !
++
Anonymous
Not applicable
Author

Hi phil,
you must have the whole xml document in one row. Depending on your data flow you could use tDenormalize for example.
Bye
Volker
Anonymous
Not applicable
Author

hi,
when i read my structure xml with tInputFileXML in logout i can extract the attritbut of element
it 's good
but when i parse the stream with component tParseXMLRow_1
i have always Exception
org.dom4j.DocumentException: Error on line 1 of document : XML document structures must start and end within the same entity. Nested exception: XML document structures must start and end within the same entity.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.dom4j.io.SAXReader.read(SAXReader.java:365)
at talenddemosjava.v1toxml_0_1.v1toxml.tFileInputFullRow_1Process(v1toxml.java:1356)
why i can't use component tParseXMLRow_1
+
Anonymous
Not applicable
Author

I think you will find the solution in my answer. tParseXmlRow is row-based. If you have spread your document over multiple rows this wouldn't work.
Anonymous
Not applicable
Author

hi,
how do i parse a stream with xml flux ?
i have only tInputFileXML , it is for file
but for stream , what do i use ?
++
Anonymous
Not applicable
Author

You could use tFileInputXml for an xml file and tParseXmlRow for XML data in an attribute of your flow. What is your input?
Anonymous
Not applicable
Author

my input is in first a file
i transform this file in xml file
with tFileinputFullRow + tJavaRow
after i use tparseXMLrow for extract XML data in an attribute of flow
it doesn't work because xml message spread over multiple rows
how can i do to extract XML data in an attribute ?
++