This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple XML, DTD, JavaScript probelems

 
Doshi Milan
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
Please help me by answering any of these three small problems in XML\DTD:
1) How to write the escape sequence in XML.
for e.g: if I want to write
<Company> Shyam & sons</Company>
Naturally it is not accepting the '&' sign. '&' is the reserved symbol for Entities and hence the prob.What should I do?
2)I have an external parsed entity in my XML file, main.xml, as under:
:
<reply> &EP; </reply>
:
In my DTD the external parsed entity EP is referencing to another XML file , say demo.xml. This file which is referred to is having its own DTD structure.
Hence when I try to see main.xml it gives me the error that there cannot be two DOC structures and so on. This is because of the second DTD , i.e the DTD of demo.xml.
So what am I supposed to do ?
3) I am using JavaScript in my XML document called dailyRates.xml as follows:
var xmlDoc=new ActiveXObject("microsoft.xmldom");
xmlDoc.load("dailyRates.xml");
root=xmlDoc.documentElement;
:
which , ofcourse loads the dailyRates.XML and I can use the Document Object model as I want.
But the probelem is that now I will be generating the XML document dailyRates.xml on the fly ( using Java ).
Within the file which is to be generated how will I pass the reference of the XML document.
i.e : what should I write xmlDoc.load(...???..);
I also want advice if the way I am using to load the XML document for use in javaScript , i.e new ActiveXObject....etc, is Ok. I mean any other suggestions?
Please reply to any of the qtns at the earliest and oblige,
Thanks in advance,
Milan Doshi
 
Ambrose Tati
Ranch Hand
Posts: 55
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Milan,
There's an XML predifined entity for &
called amp. Make sure you use
the correct syntax for entities.
i.e: &<entity name>;
It should sort you out.
Thanks
Ambrose Tati

[This message has been edited by Ambrose Tati (edited August 02, 2001).]
 
Ganesh Ram
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
& is &
 
Ganesh Ram
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
About Question 3. You could put your ActiveX code in a ASP and pass the url that produces the XML as the input to the ASP.
So the ASP would run the URL , get the XML and do whatever it has to do.
We have used some thing like this before but for a different purpose.
 
Doshi Milan
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ambrose and Ganesh,
The first one I have sorted out but for the second and third, any help please.
Ganesh, I am using Java and hence can you explain me in detail how do I get the reference of the XML document generated on the fly, (i.e Qtn 3 in my first quote).
Thanks and regards,

Milan Doshii
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic