XMLSpy: why is IDREF undefined?

Discussion in 'XML' started by Lars, Jul 12, 2003.

  1. Lars

    Lars Guest

    Hi all,
    I suspect this may be a bug in XMLSpy, since IE seems to validate this
    XML successfully. Maybe someone here has run into this and can tell
    me.

    Problem: When I try to validate the XML document hans-cc.xml in
    XMLSpy, it gives me the error
    Undefined ID 'comp-cl' referred to from attribute 'styleID'

    I have an XML file hans-cc.xml which uses entity references to include
    a file called aesthconf3.xml. Here's the beginning of hans-cc.xml:

    <?xml version="1.0" encoding="utf-8"?>
    <?xml-stylesheet type="text/xsl" href="cc-to-html.xsl"?>
    <!DOCTYPE cc SYSTEM "cc.dtd" [
    <!ENTITY ancf SYSTEM "hans-ancf.xml">
    <!ENTITY aecf SYSTEM "aesthconf3.xml">
    ]>
    <cc xmlns="http://www.gial.edu/huttar/cc/">
    <metadata dtd-version="2003-06-13T14:17:05-0500"
    source-document='Hwang, Shin Ja J. 1997. Chart of "Little Hans".
    Unpublished ms.' source-version="1997"
    document-version="2003-06-13T14:17:05-0500">
    <title>Constituent chart: "Little Hans"</title>
    <attribution>from Hwang, Shin Ja J. 1997. Chart of "Little Hans".
    Unpublished ms. Used by permission.</attribution>
    </metadata>
    &ancf;
    &aecf;
    <body>

    When XMLSpy gives me the aforementioned error, it highlights the two
    entity references shown above. (I know the entity references per se
    are not broken, as they've been there for a while and have not caused
    problems.)

    Here's part of the file aesthconf3.xml, including both the definition
    of the 'comp-cl' ID, and an IDREF referring to it (see comments):

    <?xml version="1.0" encoding="UTF-8"?>
    <aesthetic-config>
    <column-styles>
    <column-style rank="2" border-style="double"/>
    </column-styles>
    <row-styles>
    ....
    </row-styles>
    <stretch-styles>
    <stretch-style styleID="move-dest" />
    <stretch-style styleID="note" />
    <stretch-style styleID="comp-cl" /> <!-- this attr is of type ID
    -->
    <stretch-style styleID="rel-cl" />
    <stretch-style styleID="direct-quote" />
    <stretch-style styleID="italic" />
    </stretch-styles>
    <legend>
    ....
    <legend-sample description="complement clause">
    <wordStretch unitGroup="u3" styleID="compl-cl"> <!-- type IDREF
    -->
    <word>
    <vernac>text</vernac>
    </word>
    </wordStretch>
    </legend-sample>

    Here's a bit of cc-aesthconf.dtd (included by cc.dtd) which defines
    stretch-style's styleID attribute as being of type ID:

    <!-- cc:stretch-style - a container for a styleID attribute of type
    ID, for IDREFs to refer to -->
    <!ELEMENT stretch-style EMPTY>
    <!ATTLIST stretch-style styleID ID #REQUIRED>

    So... anybody see what I'm doing wrong? It seems to me I'm defining an
    ID with value 'comp-cl', yet XMLSpy tells me 'comp-cl' is an undefined
    ID.

    Obviously I haven't given all the files... that might be a bit much
    for the newsgroup, but I've put them at
    http://occs.cs.oberlin.edu/~huttar/xmlproto/tmp.html
    in case they need to be seen in entirety.

    Thanks for any help!

    By the way, I would also be happy to learn how to ask Saxon 6.5.2 (or
    rather ask Crimson, via Saxon command-line) to validate my XML as it's
    reading it in. Currently that doesn't seem to be happening. I would
    like to see whether Crimson agrees with XMLSpy that my XML is invalid.

    Regards,
    Lars
    Lars, Jul 12, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rico
    Replies:
    2
    Views:
    406
  2. kevkev

    JAXB and IdRef

    kevkev, May 18, 2005, in forum: Java
    Replies:
    3
    Views:
    4,315
    kevkev
    May 19, 2005
  3. Altova Announcements
    Replies:
    0
    Views:
    652
    Altova Announcements
    May 25, 2004
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,805
    Smokey Grindel
    Dec 2, 2006
  5. KaR
    Replies:
    0
    Views:
    664
Loading...

Share This Page