Xmllint parser error : EntityRef: expecting ';'


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Xmllint parser error : EntityRef: expecting ';'
# 1  
Old 06-10-2017
Xmllint parser error : EntityRef: expecting ';'

Hi

I have an XML file which contains html urls in that node values. When i use xmllint to parse that, i am getting error (because of the sympols in the url). i have used --html option but it throws other tag errors.

Please guide me.
Code:
sample file.xml 
<abc>
<bcd>
<cde>
<a>sometext</a>
<b>https://www.asdf.com/plaer?foreo=APYlolNO=BPYprotName=UINS%20min</b>
<c>asdf</c>
</cde>
</bcd>
</abc>

tried
Code:
echo "cat /abc/bcd/cde/a/text()" | xmllint  --nocdata --html --shell file.xml | sed '1d;$d'

error:
Code:
parser error : EntityRef: expecting ';'
<b>https://www.asdf.com/plaer?foreo=APYlolNO=BPYprotName=UINS%20min
                                                                       ^(this symbol was pointing in the = sign)

Moderator's Comments:
Mod Comment Please use CODE tags (not QUOTE tags) when displaying sample input, output, and code segments. (Using QUOTE tags collapses sequences of zero or more<space> and <tab> characters at the start of a line to nothing and other sequences of one or more <space> and <tab> characters to a single <space>.

Last edited by ananan; 06-12-2017 at 02:26 PM..
# 2  
Old 06-10-2017
Putting a ... in your diagnostic message instead of the actual text that was displayed makes it impossible for us to see where in that message xmlint thought there should be a semicolon character.

Please post the exact diagnostic message xmlint printed in CODE tags (not QUOTE tags).
# 3  
Old 06-10-2017
I'm afraid it's the browser or the server or the editor? that added [URL] tags and put the ... in lieu of the real partial string. I removed the [URL] tags to display the entire string; unfortunately, the caret still point to nowhere...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Xmllint: get one result per line

Hi, I'm trying to get some values from an xmlfile and want be able to process them. I'm using xmllint(v20901 on debian jessie) and this program directly outputs all results concatenated right after each other. I did not find a solution in the man page to get a different format or some output... (2 Replies)
Discussion started by: stomp
2 Replies

2. UNIX for Beginners Questions & Answers

Script not returning what I am expecting

Hi there I am trying to create a script where I am checking the process is being run by the correct user, when I go to run the script it is not returning what I am expecting and I am not 100% sure why!!! First off I have determined what the process user should be at the top of the script ... (3 Replies)
Discussion started by: simpsa27
3 Replies

3. Shell Programming and Scripting

Help with xmllint

Have like 50 xml files in a folder. They all have a Node named <Number>.How to display the values of <Number> with the count and filename in the folder. I am using Mac . (7 Replies)
Discussion started by: Anethar
7 Replies

4. Shell Programming and Scripting

Parse XML using xmllint

Hi All, Need help to parse the xml file in shell script using xmllint. Below is the sample xml file. <CARS> <AUDI> <Speed="45"/> <speed="55"/> <speed="75"/> <speed="95"/> </AUDI> <BMW> <Speed="30"/> <speed="75"/> <speed="120"/> <speed="135"/> </BMW>... (6 Replies)
Discussion started by: prasanna2166
6 Replies

5. Shell Programming and Scripting

Linux xmllint schema validation fails but error code 0

Command line xmllint --schema validation fails but $? returns 0 myinput.xml: <myinput><header>mytestvalue</header></myinput>myschema.xsd <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name="myinput" type="xsd:string"/> </xsd:schema>Command: $xmllint --schema... (4 Replies)
Discussion started by: mknag
4 Replies

6. UNIX for Dummies Questions & Answers

grep, expecting 1 result, getting more

Hi Please take a look below, I'm grepping for /app/oracle and would like explicitly that result and not /app/oracle/admin as well. # cat /tmp/fs.list /app/oracle /app/oracle/admin # cat /tmp/fs.list | grep -w "/app/oracle" /app/oracle /app/oracle/admin (3 Replies)
Discussion started by: s1ckle
3 Replies

7. Solaris

expecting answers for these questions?

hi all plese clarify me in the following area. 1. What is the default NFS version in solaris 5.10. If it is 3, then why it asks me to specify "-o vers=3" keyword while i am mounting a share from a RHEL 5.1 Server? 2. Can someone give the link to download packages for accessing "ntfs"... (4 Replies)
Discussion started by: kingston
4 Replies

8. Shell Programming and Scripting

Syntax error: word unexpected (expecting ")")

I have a very simple script that reads in the contents of a file (_open.txt) into an array "lyrics": #!/bin/sh # read in the text lyrics=( `cat _open.txt` | tr '\n' ' ') exit 0 It gives the following error message: ./lyrics.sh: 1: Syntax error: word unexpected (expecting ")") I have... (9 Replies)
Discussion started by: figaro
9 Replies

9. Shell Programming and Scripting

xmllint output to a file

Hello All, I have an XML file which has some errors in its tag definition according to an xsd. When i validate this xml file against an xsd, i wish to only take the errors in a file and not the complete xml. for eg. Raman.xml has some errors induced in it. RamanValidator.xsd holds the schema... (5 Replies)
Discussion started by: damansingh
5 Replies

10. UNIX for Advanced & Expert Users

iconv and xmllint

Here is my question, volume of records processed : 5M ( approx ) Its basically very simple operation that am trying to do and I had achieved the output that am interested. What am looking for really is to improve the performance, an optimized way to do that. with respect to iconv, am... (3 Replies)
Discussion started by: matrixmadhan
3 Replies
Login or Register to Ask a Question