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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Using HTML tag on xml file from txmlmap

Hello, I have a XML file with many rows, and in my tXmlMap, I need one rows who contains html

0683p000009LscJ.png

In this rows, I use the html tag in my tXmlMap, but he stop read at the first line and talend send me error

ORA-01400: Cannot insert NULL into ("DB"."table"."column")

But, other xml file with many html rows , its working for exemple, after my <p> Hello, </p> I press enter to make a new line, its working

 

Edit: I tried to use this

StringHandling.EREPLACE(row2.html,"</p>","</p><br>") 

but nothing

 

 

Labels (1)
42 Replies
Anonymous
Not applicable
Author

You're not using XML. XML and HTML are similar but are not interchangeable. If you want to parse HTML, you will need to use third party Java APIs. I have written a tutorial on how this can be done here: https://www.rilhia.com/tutorials/using-third-party-java-library-scrape-content-table-web-page

 

 

Anonymous
Not applicable
Author

when I press space between

<my:Description><html xmlns="http://www.w3.org/1999/xhtml" xml:space="preserve"> <p>​

my html tag and <p> tag its work fine, but the file comes with no space and I can't edit file (The job insert the data in db)

 

Anonymous
Not applicable
Author

What error are you getting? The actual error in the output window in full.

Anonymous
Not applicable
Author

Anonymous
Not applicable
Author

0683p000009Lsj5.pngThis is from normal xml file without the space between  ><p>

 

and 0683p000009LsLR.png

this is when i put space between ><p>

Anonymous
Not applicable
Author

This is a nasty file to work with. I don't believe it is well formed at all....but then Microsoft seldom conform to standards. The "my" is not bound....was the file you sent me edited? Anyway, after removing the broken XML I was able to get the following XPath to work with or without a space between html and <p> ....

 

"./DATA/Description/html/p"

 

I was using just a tFileInputXML and had "/WebFORM" as the Loop XPath query.

 

Anonymous
Not applicable
Author

Hi and thx for reply, so yes I upload a new file, sorry I edited the old file.

 

I don't use the XPath "./DATA/Description/html/p" because I have other XML file with many tag like this and its show me only the first <p> tag , "Bonjour," and not all tag, and I used "./DATA/Description//*"  to read all line in description


Besoin%20Assistance-2018-02-13T15_02_15-test2.xml
Anonymous
Not applicable
Author

Using your new file (it is still missing a namespace for "my", but I added a dummy one), I was able to return .....

<html xmlns="http://www.w3.org/1999/xhtml" xml:space="preserve"><p>​Bonjour,</p>
<p>Je vous remercie de bien vouloir renommer le répertoire Solidarités par Actions Solidaires qui se trouve sur H, direction des Solidarités et de la Santé Publique.</p>
<p>Cordialement</p>
<p>Stest </p></html>

....using an XPath of "./my0683p000009MACJ.pngATA/my0683p000009MACJ.pngescription/html" and keeping "Get Nodes" ticked. By unticking "Get Nodes" I get .....

Bonjour,
Je vous remercie de bien vouloir renommer le répertoire Solidarités par Actions Solidaires qui se trouve sur H, direction des Solidarités et de la Santé Publique.
Cordialement
Stest

Is this not what you want? 

Anonymous
Not applicable
Author

Did the above work?

Anonymous
Not applicable
Author

Hey, sorry for late reply ( time difference maybe 0683p000009MANf.png )  So I tried again the XPath

 "/my:DATA/my:Description/html"

But it still return me all the html in my xml file, its Ok

 

But ther is not returning html on file with only one <p> tag like this file !

0683p000009Lsg8.png


Besoin.xml