Parsing Error while Parsing XML file
843834Sep 30 2002 — edited Oct 1 2002Hi I am trying to parse an xml file with use of an stylehseet as shown below but its giving an error message as follows
[Fatal Error] myfile2.xml:1:8: The processing instruction target matching "[xX][mM][lL]" is not allowed.
org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:235)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:201)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at Stylizer.main(Stylizer.java:50)
The sample xml file is
- <nitf id="366045">
- <head>
<title type="main">������� �������� ������</title>
- <tobject toobject.type="���� �����">
<tobject.subject tobject.subject.type="�����" tobject.subject.matter="����� ������" />
</tobject>
- <docdata>
<date.issue norm="28/09/2002" />
<doc.copyright year="YYYY" holder="Aljazeera.net" />
</docdata>
<pubdata type="web" position.section="�����" />
</head>
- <body>
- <body.head>
- <hedline>
<hl1>������� �������� ������</hl1>
</hedline>
- <byline>
<person>�������</person>
</byline>
- <dateline>
<location>�����</location>
<story.date>31/03/1999</story.date>
</dateline>
<abstract>����� ����������� �������������� ���� ����� �������� ���� ��� ������� ������ �� ����� ������.</abstract>
</body.head>
<body.content>���� ������: �� ��� ��������. ���� ���� ��� ���� ���� �� ���� ����.</body.content>
</body>
</nitf>
and stylesheet file is as follows:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" >
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="NITF_News/News/nitf">
<xsl:value-of select='body.head/hedline/hl1'/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Now can anyone tell me why is this coming up
Thanks
Raj