schematron question

Discussion in 'XML' started by shaun roe, Sep 16, 2005.

  1. shaun roe

    shaun roe Guest

    I want to ensure that a reference from one element to another is valid,
    e.g

    <character name="sleepy">
    <friends_with name="doc"/>
    </character>

    <character name="sneezy">
    <friends_with name="sleepy"/>
    </character>

    I want to ensure that the value of the name attribute in "friends_with"
    actually exists somewhere in the file as a <character name> somewhere.
    (if the above were the entire file, then the first element would be
    invalid since "doc" is not a charc ater name in the file)



    Can I do this with schematron?
     
    shaun roe, Sep 16, 2005
    #1
    1. Advertising

  2. That can be done in W3C XML Schema (Presumably RelaxNG as well) using keys and
    keyrefs. You could do it with Schematron if you really want to, but this is
    not a case where you have to use it.

    On Fri, 16 Sep 2005 21:52:15 +0200, shaun roe <> wrote:

    >I want to ensure that a reference from one element to another is valid,
    >e.g
    >
    ><character name="sleepy">
    > <friends_with name="doc"/>
    ></character>
    >
    ><character name="sneezy">
    > <friends_with name="sleepy"/>
    ></character>
    >
    >I want to ensure that the value of the name attribute in "friends_with"
    >actually exists somewhere in the file as a <character name> somewhere.
    >(if the above were the entire file, then the first element would be
    >invalid since "doc" is not a charc ater name in the file)
    >
    >
    >
    >Can I do this with schematron?
     
    Steve Jorgensen, Sep 17, 2005
    #2
    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. gabriel
    Replies:
    3
    Views:
    1,546
    Colin Mackenzie
    Jun 25, 2003
  2. disteve

    Schematron question

    disteve, Apr 27, 2005, in forum: XML
    Replies:
    0
    Views:
    433
    disteve
    Apr 27, 2005
  3. paul.hermans
    Replies:
    0
    Views:
    351
    paul.hermans
    May 1, 2005
  4. paul.hermans
    Replies:
    0
    Views:
    376
    paul.hermans
    May 1, 2005
  5. Steve Jorgensen
    Replies:
    0
    Views:
    535
    Steve Jorgensen
    Jul 27, 2005
Loading...

Share This Page