[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    Re: key and keyref support
From:       hong zhang <hzhang999 () gmail ! com>
Date:       2004-10-29 15:34:16
Message-ID: a66541c60410290834624a485a () mail ! gmail ! com
[Download RAW message or body]

Thanks Radu.
The problem is: how can I get a SchemaIdentityConstraint object?


On Thu, 28 Oct 2004 17:04:53 -0700, Radu Preotiuc-Pietro <radup@bea.com> wrote:
> Yes, you can't use SchemaType for that, because identity constraints are
> somewhat "parallel" to types in that an element will have a type and
> potentially one or more identity constraints associated to it.
> What you can do though, is use
> SchemaIdentityConstraint.getSelectorPath() and then pass that into
> XmlObject.executePath(). You then have a list of positions in the
> document where the respective selector occurs.
> 
> Hope this helps,
> Radu
> 
> 
> 
> -----Original Message-----
> From: hong zhang [mailto:hzhang999@gmail.com]
> Sent: Thursday, October 28, 2004 1:35 PM
> To: xmlbeans-dev@xml.apache.org
> Subject: key and keyref support
> 
> I am in the process of evaluating XMLBean. It looks pretty good to me.
> I have a question regarding <keyref and <key.
> Here's a portion of my schema:
>                <xsd:key name="itemKey">
>                        <xsd:selector xpath="./items/item"/>
>                        <xsd:field xpath="@code"/>
>                </xsd:key>
>                <xsd:keyref name="NoIllegalEntries" refer="itemKey">
>                        <xsd:selector xpath="./aisle/itemref"/>
>                        <xsd:field xpath="@code"/>
>                </xsd:keyref>
> And here's portion of the XML file:
>        <aisle name="fruits" number="1">
>                <itemref code="003" quantity="60" price="3.15"/>
>        </aisle>
> My question is:
> .When I iterate to the  code attribute of <itemref, how can I know
> it's a keyref instead of just a normal attribute? I tried to use
> XMLObject.schemaType(), but it doesn't contain that information?
> Also, how can I get the reference to key, by XMLObject.execute()?
> 
> Any input will be highly appreciated.
> 
> Hong
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic