Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
| Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 13th, 2007, 10:25 AM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to arvind@allfon
Default hi pls help on this semicolon data

hi
  my xml data in a node contains semicolon its a needed data. while parsing this xml doc with an xsl

to get an html data im getting an error in the java transformer object. the error message is as

follows
"XML document structures must start and end within the same entity"

the sample data is shown:

<file-send>to isa server; the data is sent</file-send>(note: the semicolon here used is not for

seperating or spliting the data).

this node containg xml file is given to the code like this

1. TransformerFactory tFactory = TransformerFactory.newInstance();
2. InputStream inputStream = this.getClass().getClassLoader().getResourceAsStre am(xslPath); (note:

here xslPath is ip xsl string)
3. Transformer transformer = tFactory.newTransformer(new StreamSource(inputStream));
4. transformer.transform(new StreamSource(new StringReader(XMLString)), new StreamResult(html));

(note: here XMLString is ip xml string)

in the line 4 the problem arises and the execption caught. the Execption message is "XML document

structures must start and end within the same entity"

pls help me to get the semicolon in the generated html

 
Old February 13th, 2007, 10:51 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

There's nothing wrong with the semicolon, but it does seem as if your input file contains invalid XML.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old February 14th, 2007, 10:34 AM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to arvind@allfon
Default

the input xml is working fine, i say this because while applying xml on the xsl manually without the code in the browser using this tag
<?xml-stylesheet type="text/xsl" href="formatsampleXML.xsl"?>

while applying this i get the semicolon in the generated html output . but this not the scenario while im doing this in the java code, pls tel me if i can respesent the semicolon in some other reference entity format eg & -> &amp; like wise . im using UTF-8 encoding . pls help its needed urgently thanks in advance

 
Old February 14th, 2007, 10:51 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You haven't shown us the declaration and initialization of the java variable XMLString.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old February 20th, 2007, 06:36 AM
Registered User
 
Join Date: Feb 2007
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to arvind@allfon
Default

sir thats all working fine. i want to know whether an ; in the xml data when applied to an transformation xsl can it retain the ; in the generated xml. im not talking in the standalone transformation, instead im talking abt the transformation using java TransformerFactory

 
Old February 20th, 2007, 08:09 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You *still* haven't shown us the declaration and initialization of the java variable XMLString.

Please stop asking the same question again and again, while ignoring the responses.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference




Similar Threads
Thread Thread Starter Forum Replies Last Post
Struts 2.2, Json data and jsp problem, help pls ish Struts 0 July 8th, 2008 04:59 AM
splitting up items separated by semicolon Condor76 XSLT 1 March 17th, 2008 05:14 PM
pls give the query for XML data in Sqlserver2005 veeruu SQL Server 2005 0 July 27th, 2006 05:07 AM
missing semicolon absolutelymk Access 2 May 5th, 2006 10:10 AM
Missing semicolon? jakeone Access 4 February 15th, 2005 12:26 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.