Loading ...
Sorry, an error occurred while loading the content.

RE: [XSL-FO] escape "&" in xml file

Expand Messages
  • joyce huang
    Thank you for the reply. I know in many case, to escape the & in xml is the right solution. But in my case, the data is generated from a cobal program, the
    Message 1 of 4 , Jan 18, 2005
    • 0 Attachment
      Thank you for the reply.
      I know in many case, to escape the "&" in xml is the
      right solution.

      But in my case, the data is generated from a cobal
      program, the guy who wrote this program said cobal is
      very strict with length of data, it will cause him
      very much pain to substitute "&" with "&" because
      "&" has only one character but "&" has five
      characters. So the xml file he passes over to my
      program is already a xml file with "&" in it. and of
      course it failed the validation.

      I hope I can find a way to transform this not
      well-formed xml file. but how? this is my question.

      Thank you again.
      Joyce Huang

      --- Victor Vishnyakov <tch_@...> wrote:

      > The general clue is to substitute & with &
      >
      > Best Regards,
      > Victor Vishnyakov
      > http://xslfo-zone.com/
      >
      >
      >
      > -----Original Message-----
      > From: joyce_huang8888
      > [mailto:joyce_huang8888@...]
      > Sent: Tuesday, January 18, 2005 6:15 PM
      > To: XSL-FO@yahoogroups.com
      > Subject: [XSL-FO] escape "&" in xml file
      >
      >
      >
      >
      > I am currently working on a java program that takes
      > in xml and xslfo
      > files and output postscript. Some of the xml
      > contents contain "&"
      > character, and the xml messages are taken from
      > message queue with a
      > cobal program. This is to say that my data source is
      > from cobal. I
      > don't know much about cobal, but I know that they
      > uses cobal copy
      > book which makes it difficult to escape the "&"
      > character when they
      > generate xml messages. So the xml data feed into my
      > program may
      > have "&" in it, which causes ParserException in my
      > java program while
      > doing the postscirpt rendering.
      >
      > Anyone knows how to fix this? In one word, if you
      > have a xml file
      > with "&" in it, how you going to do get through the
      > xml validation?
      >
      > Appreciate your help!
      > Joyce Huang
      >
      >
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
      >
      >
      >
      >
      >




      __________________________________
      Do you Yahoo!?
      Yahoo! Mail - 250MB free storage. Do more. Manage less.
      http://info.mail.yahoo.com/mail_250
    • Victor Vishnyakov
      Then you should switch entities resolution off in your XML parser. Regards, Victor Vishnyakov http://xslfo-zone.com/
      Message 2 of 4 , Jan 18, 2005
      • 0 Attachment
        Then you should switch entities resolution off in your XML parser.

        Regards,
        Victor Vishnyakov
        http://xslfo-zone.com/



        > -----Original Message-----
        > From: joyce huang [mailto:joyce_huang8888@...]
        > Sent: Tuesday, January 18, 2005 10:21 PM
        > To: XSL-FO@yahoogroups.com
        > Subject: RE: [XSL-FO] escape "&" in xml file
        >
        >
        > Thank you for the reply.
        > I know in many case, to escape the "&" in xml is the right solution.
        >
        > But in my case, the data is generated from a cobal program,
        > the guy who wrote this program said cobal is very strict with
        > length of data, it will cause him very much pain to
        > substitute "&" with "&" because "&" has only one
        > character but "&" has five characters. So the xml file he
        > passes over to my program is already a xml file with "&" in
        > it. and of course it failed the validation.
        >
        > I hope I can find a way to transform this not well-formed xml
        > file. but how? this is my question.
        >
        > Thank you again.
        > Joyce Huang
        >
        > --- Victor Vishnyakov <tch_@...> wrote:
        >
        > > The general clue is to substitute & with &
        > >
        > > Best Regards,
        > > Victor Vishnyakov
        > > http://xslfo-zone.com/
        > >
        > >
        > >
        > > -----Original Message-----
        > > From: joyce_huang8888
        > > [mailto:joyce_huang8888@...]
        > > Sent: Tuesday, January 18, 2005 6:15 PM
        > > To: XSL-FO@yahoogroups.com
        > > Subject: [XSL-FO] escape "&" in xml file
        > >
        > >
        > >
        > >
        > > I am currently working on a java program that takes in xml
        > and xslfo
        > > files and output postscript. Some of the xml contents contain "&"
        > > character, and the xml messages are taken from message queue with a
        > > cobal program. This is to say that my data source is from cobal. I
        > > don't know much about cobal, but I know that they uses
        > cobal copy book
        > > which makes it difficult to escape the "&"
        > > character when they
        > > generate xml messages. So the xml data feed into my program
        > may have
        > > "&" in it, which causes ParserException in my java program
        > while doing
        > > the postscirpt rendering.
        > >
        > > Anyone knows how to fix this? In one word, if you have a
        > xml file with
        > > "&" in it, how you going to do get through the xml validation?
        > >
        > > Appreciate your help!
        > > Joyce Huang
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        > > Yahoo! Groups Links
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        > >
        >
        >
        >
        >
        > __________________________________
        > Do you Yahoo!?
        > Yahoo! Mail - 250MB free storage. Do more. Manage less.
        > http://info.mail.yahoo.com/mail_250
        >
        >
        >
        > Yahoo! Groups Links
        >
        >
        >
        >
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.