Click to See Complete Forum and Search --> : XML - DTD - Special Characters


gairaldi
09-04-2003, 09:07 AM
I have this xml.. and the dtd is pasted below:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE root SYSTEM "http://shoptest-ar.itx.net/ASynch/spec_char.dtd"> <root> <record> <srv>text</srv> <database>text</database> <dblogin>text</dblogin> <dbpwd>astest</dbpwd> <login>login</login> <password>óe7(Ä</password> <option>1</option> <LastSync>06/08/2003 03:21:30 p.m.</LastSync> </record> </root>

When I try to load it using set xml_dom = Server.CreateObject("MSXML2.DOMDocument") I get the folowing error message: "An invalid character was found in text content." That's because of password which has special characters. What am I doing wrong? I want that characters to be accepted. They are always different. That xml is generated automatically when the user logs into the system.. The password is the one which the users enters but it is encrypted. Any idea, please? Thank you very much!


<!-- ENTITY sets -->

<!-- ISO 9573-13 -->

<!ENTITY % ent-isoamsa SYSTEM "dtd\isoamsa.ent" > %ent-isoamsa;

<!ENTITY % ent-isoamsb SYSTEM "dtd\isoamsb.ent" > %ent-isoamsb;

<!ENTITY % ent-isoamsc SYSTEM "dtd\isoamsc.ent" > %ent-isoamsc;

<!ENTITY % ent-isoamsn SYSTEM "dtd\isoamsn.ent" > %ent-isoamsn;

<!ENTITY % ent-isoamso SYSTEM "dtd\isoamso.ent" > %ent-isoamso;

<!ENTITY % ent-isoamsr SYSTEM "dtd\isoamsr.ent" > %ent-isoamsr;

<!ENTITY % ent-isogrk3 SYSTEM "dtd\isogrk3.ent" > %ent-isogrk3;

<!ENTITY % ent-isogrk4 SYSTEM "dtd\isogrk4.ent" > %ent-isogrk4;

<!ENTITY % ent-isomfrk SYSTEM "dtd\isomfrk.ent" > %ent-isomfrk;

<!ENTITY % ent-isomopf SYSTEM "dtd\isomopf.ent" > %ent-isomopf;

<!ENTITY % ent-isomscr SYSTEM "dtd\isomscr.ent" > %ent-isomscr;

<!ENTITY % ent-isotech SYSTEM "dtd\isotech.ent" > %ent-isotech;



<!-- ISO 8879 -->

<!ENTITY % ent-isobox SYSTEM "dtd\isobox.ent" > %ent-isobox;

<!ENTITY % ent-isocyr1 SYSTEM "dtd\isocyr1.ent" > %ent-isocyr1;

<!ENTITY % ent-isocyr2 SYSTEM "dtd\isocyr2.ent" > %ent-isocyr2;

<!ENTITY % ent-isodia SYSTEM "dtd\isodia.ent" > %ent-isodia;

<!ENTITY % ent-isogrk1 SYSTEM "dtd\isogrk1.ent" > %ent-isogrk1;

<!ENTITY % ent-isogrk2 SYSTEM "dtd\isogrk2.ent" > %ent-isogrk2;

<!ENTITY % ent-isolat1 SYSTEM "dtd\isolat1.ent" > %ent-isolat1;

<!ENTITY % ent-isolat2 SYSTEM "dtd\isolat2.ent" > %ent-isolat2;

<!ENTITY % ent-isonum SYSTEM "dtd\isonum.ent" > %ent-isonum;

<!ENTITY % ent-isopub SYSTEM "dtd\isopub.ent" > %ent-isopub;

<!-- MathML aliases for characters defined above -->

<!ENTITY % ent-mmlalias SYSTEM "dtd\mmlalias.ent" > %ent-mmlalias;


<!-- MathML new characters -->

<!ENTITY % ent-mmlextra SYSTEM "dtd\mmlextra.ent" > %ent-mmlextra;

<!-- end of ENTITY sets -->

<!ELEMENT root (record)> <!ELEMENT record (srv,database,dblogin,dbpwd,login,password,option,LastSync)> <!ELEMENT srv (#PCDATA)> <!ELEMENT database (#PCDATA)> <!ELEMENT dblogin (#PCDATA)> <!ELEMENT dbpwd (#PCDATA)> <!ELEMENT login (#PCDATA)> <!ELEMENT password (#PCDATA)> <!ELEMENT option (#PCDATA)> <!ELEMENT LastSync (#PCDATA)>

Khalid Ali
09-08-2003, 09:12 AM
you will have to replace those characters with their corresponding ASCII value

something like

percent sign % %

gairaldi
09-08-2003, 01:35 PM
Ali,

How should I have to replace the special characters? Would you give me a short example, please?
Thanks in advance,

Gisella.

buddy1908
02-03-2004, 03:50 PM
I know how what substitutes to used for special characters like & can be substituted by &amp; in XML .

What I want to know is how can this be done efficiently.
I want to know how I can automatically tell parser to accept " & " or any other special character, if I cannot do it through parser then how can I tell the parser to convert special characters to accepted character format in XML.

Thanks,
Buddy