• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Simple XML, DTD, JavaScript probelems

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
& is &
 
Ganesh Ram
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic