Results 1 to 5 of 5

Thread: InvalidOperationException while reading SGML with root's attribute missing quotes

  1. #1

    Default InvalidOperationException while reading SGML with root's attribute missing quotes

    I have two sgml files that differ only in the root attribute (removed the rest of the sgml for clarity):

    SGML A starts with: <sgml attr="-//TEST//TEST SGML//EN">

    SGML B starts with: <sgml attr=-//TEST//TEST SGML//EN>

    Notice that the only difference is that SGML A has double quotes that delimit the attr value.

    Now, when I try to load each file into an xml stream, SGML A loads onto the xml stream with no errors, but SGML B gets an InvalidOperationException with a "There was no XML start tag open." error message.

    Here's the snippet of code where SGML B fails:
    Code:
                        sgmlReader.Read();
                        while (!sgmlReader.EOF)
                        {
                            xmlOutputWriter.WriteNode(sgmlReader, true);
                        }
                        xmlOutputWriter.Flush();
    Is there any property that I need to set for SMGL B in order for it to work?

    Update: After further tests, I may have figured out why the quotes make such a difference: the trailing /EN> of SGML B causes SgmlReader to think that this is the end of the <EN> tag, which doesn't exist! Could this be a bug in SgmlReader?

    Thanks,
    George
    Last edited by straudlater; 06-18-2010 at 03:34 PM. Reason: update

  2. #2
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    Yes, that sounds like a bug. In general, SgmlReader should never throw an exception, regardless of how poorly the input is formatted. Please submit a bug report with the input that caused the error. Thanks!
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

  3. #3

    Default

    Thanks! I've submitted a bug report, along with a real-world SGML file.

  4. #4
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    Wonderful. Thank you!
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

  5. #5

    Default

    Any updates to this issue?

    I noticed in the bug report that it was downgraded from "Open" to "To be discussed" back in October 2010...just curious I guess.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts