Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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

Reply With Quote
  #2 (permalink)  
Old February 13th, 2007, 10:51 AM
mhkay's Avatar
Wrox Author
Points: 18,438, Level: 59
Points: 18,438, Level: 59 Points: 18,438, Level: 59 Points: 18,438, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,954
Thanks: 0
Thanked 290 Times in 285 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
Reply With Quote
  #3 (permalink)  
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

Reply With Quote
  #4 (permalink)  
Old February 14th, 2007, 10:51 AM
mhkay's Avatar
Wrox Author
Points: 18,438, Level: 59
Points: 18,438, Level: 59 Points: 18,438, Level: 59 Points: 18,438, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,954
Thanks: 0
Thanked 290 Times in 285 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
Reply With Quote
  #5 (permalink)  
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

Reply With Quote
  #6 (permalink)  
Old February 20th, 2007, 08:09 AM
mhkay's Avatar
Wrox Author
Points: 18,438, Level: 59
Points: 18,438, Level: 59 Points: 18,438, Level: 59 Points: 18,438, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,954
Thanks: 0
Thanked 290 Times in 285 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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:52 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.