SX- sgml to xml conversion problems

U

Usman

Dear friends,

I would like to ask about James Clark sx.exe parser from SGML to XML.
I write the batch file like this :
"E:\Project\sx\sx.exe" -wall
"-DE:\Project\sx\entities" "-fE:\Project\error.log"
-xndata "E:\Project\xyz.dtd" "E:\Project\xyz.sgm" > "E:\Project\xyz.xml"

E:\Project\sx\sx.exe:E:\Project\xyz.sgm:15:55:W: reference to internal
SDATA entity "ldquo" not allowed in
XML
E:\Project\sx\sx.exe:E:\Project\xyz.sgm:15:77:W: reference to internal
SDATA entity "rdquo" not allowed in
XML
E:\Project\sx\sx.exe:E:\Project\xyz.sgm:18:79:W: reference to internal
SDATA entity "rdquo" not allowed in
XML
....


I have included entity files ISOTech, ISONum etc and ldquo, rdquo etc are
defined there (so should they really be considered as internal entities?).

Can anyone help resolve these problems and their cause.
Alternatively, after generating the resulting xml files which contains
references but not the declarations to such entities, how can we handle
those entitity references at XML post-processing time.

Thanks.
U
 
M

Morus Walter

E:\Project\sx\sx.exe:E:\Project\xyz.sgm:15:55:W: reference to internal
SDATA entity "ldquo" not allowed in
XML
SGML SDATA entities are different from XML entities just doing text
replacement.

So sx has no way to generate XML entity declarations in general.
For special charactars you can
- change the DTD to declare these entities as text replacement in sgml
(requires unicode handling, so this may be problematic).
Basically you have to change a declaration
<!ENTITIY bla SDATA "[bla ]">
to
<!ENTITIY bla "<whateverblastandsfor>">
Then the entities should be replaced and you should get xml with
apropirate unicode characters.
UNTESTED.
- ignore the warnings. sx will keep the entities. Simply add an apropriate
DTD declaring the entities for xml and things should work.
Works for me.

HTH
Morus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top