XSchema Problem with xs:any

Discussion in 'XML' started by Tjerk Wolterink, Oct 27, 2005.

  1. I've a element definition like this:

    --
    <xs:element name="content">
    <xs:complexType>
    <xs:sequence>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
    <xs:any namespace="http://www.w3.org/1999/xhtml"/>
    <xs:element ref="message"/>
    </xs:choice>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    --

    But when i validate the following xml:

    --
    <content>
    <p xmlns="http://www.w3.org/1999/xhtml">
    Welkom bij <b>Wolterink</b> Webdesign<br/>
    </p>
    </content>
    --


    I get the following error:

    --
    [Xerces-J 2.7.1] Validating "index.xml" against
    "file:/D:/development/webapps/XCManager/web/WEB-INF/schemas/page.xsd" ...
    Ln 8 Col 43 - cvc-complex-type.2.4.c: The matching wildcard is strict,
    but no declaration can be found for element 'p'.
    1 Errors
    --

    Ln 8 Col 43 is the following line:
    <p xmlns="http://www.w3.org/1999/xhtml">

    How can this be??
    p is a element in the xhtml namespace so it is
    valid for:
    <xs:any namespace="http://www.w3.org/1999/xhtml"/>

    What am i doing wrong?
     
    Tjerk Wolterink, Oct 27, 2005
    #1
    1. Advertising

  2. Tjerk Wolterink writes:

    > <xs:any namespace="http://www.w3.org/1999/xhtml"/>
    >
    > But when i validate the following xml:
    >
    > --
    > <content>
    > <p xmlns="http://www.w3.org/1999/xhtml">
    > Welkom bij <b>Wolterink</b> Webdesign<br/>
    > </p>
    > </content>
    > --
    >
    >
    > I get the following error:
    >
    > --
    > [Xerces-J 2.7.1] Validating "index.xml" against
    > "file:/D:/development/webapps/XCManager/web/WEB-INF/schemas/page.xsd"
    > ...
    > Ln 8 Col 43 - cvc-complex-type.2.4.c: The matching wildcard is strict,
    > but no declaration can be found for element 'p'.
    > 1 Errors


    The error message tells you what you need to know --- "The matching
    wildcard is strict".

    If you don't want strict processing, you have to say

    <xs:any namespace="http://www.w3.org/1999/xhtml"
    processContents="lax"/>

    ht
    --
    Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
    Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
    Fax: (44) 131 650-4587, e-mail:
    URL: http://www.ltg.ed.ac.uk/~ht/
    [mail really from me _always_ has this .sig -- mail without it is forged spam]
     
    Henry S. Thompson, Oct 27, 2005
    #2
    1. Advertising

  3. Henry S. Thompson wrote:
    > Tjerk Wolterink writes:
    >
    >
    >> <xs:any namespace="http://www.w3.org/1999/xhtml"/>
    >>
    >>But when i validate the following xml:
    >>
    >>--
    >> <content>
    >> <p xmlns="http://www.w3.org/1999/xhtml">
    >> Welkom bij <b>Wolterink</b> Webdesign<br/>
    >> </p>
    >> </content>
    >>--
    >>
    >>
    >>I get the following error:
    >>
    >>--
    >>[Xerces-J 2.7.1] Validating "index.xml" against
    >>"file:/D:/development/webapps/XCManager/web/WEB-INF/schemas/page.xsd"
    >>...
    >>Ln 8 Col 43 - cvc-complex-type.2.4.c: The matching wildcard is strict,
    >>but no declaration can be found for element 'p'.
    >>1 Errors

    >
    >
    > The error message tells you what you need to know --- "The matching
    > wildcard is strict".
    >
    > If you don't want strict processing, you have to say
    >
    > <xs:any namespace="http://www.w3.org/1999/xhtml"
    > processContents="lax"/>
    >
    > ht



    Hmm okay, i did not know what strict meant,
    i will look into it further, anyway thanks!
     
    Tjerk Wolterink, Oct 27, 2005
    #3
    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. Karl
    Replies:
    3
    Views:
    355
  2. Binesh Bannerjee
    Replies:
    3
    Views:
    1,644
    Martin Honnen
    Nov 27, 2004
  3. Tjerk Wolterink

    XSchema: help

    Tjerk Wolterink, Sep 1, 2005, in forum: XML
    Replies:
    1
    Views:
    558
    Soren Kuula
    Sep 1, 2005
  4. Tjerk Wolterink

    xschema: problem

    Tjerk Wolterink, Sep 1, 2005, in forum: XML
    Replies:
    0
    Views:
    403
    Tjerk Wolterink
    Sep 1, 2005
  5. Tjerk Wolterink

    XInclude and XSchema

    Tjerk Wolterink, Oct 11, 2005, in forum: XML
    Replies:
    9
    Views:
    1,756
    Tjerk Wolterink
    Oct 13, 2005
Loading...

Share This Page