Sponsored Content
Top Forums Shell Programming and Scripting Xmllint parser error : EntityRef: expecting ';' Post 302998971 by ananan on Saturday 10th of June 2017 01:58:07 PM
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..
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
libxml(3)						     Library Functions Manual							 libxml(3)

NAME
libxml - library used to parse XML files DESCRIPTION
The libxml library is used to parse XML files. Its internal document repesentation is as close as possible to the DOM (Document Object Model) interface, an API for accessing XML or HTML structured documents. The libxml library also has a SAX-like interface, which is designed to be compatible with that of another XML parser library called expat. NOTE: SAX, the Simple API for XML, is a standard interface for event-based XML parsing, developed collaboratively by the members of the XML-DEV mailing list, currently hosted by OASIS. The expat library is a XML 1.0 parser written in C, which aims to be fully conforming. It is currently not a validating XML processor. The libxml library now includes a nearly complete XPath implementation. The XPath (XML Path Language) is a language for addressing parts of an XML document, designed to be used by both XSLT and XPointer. The libxml library exports Push and Pull type parser interfaces for both XML and html. FILES
/usr/lib/libxml2.so shareable library /usr/bin/xmlcatalog binary application for parsing and manipulating XML or SGML catalog files /usr/bin/xmllint binary application for parsing XML files /usr/bin/xml2-config binary application for printing library configuration /usr/include/libxml2 header files AUTHORS
Daniel Veillard (daniel@veillard.com). If you download and install this package please send the author email. Manual page by Ziying Sher- win (sherwin@nlm.nih.gov), Lister Hill National Center for Biomedical Communications, U.S. National Library of Medicine. SEE ALSO
xmlcatalog(1), xmllint(1), xml2-config(1). NOTES
Source for libxml is available on http://opensolaris.org. Documentation for libxml is available on-line at http://www.xmlsoft.org/ 23 May 2002 libxml(3)
All times are GMT -4. The time now is 09:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy