Using schema in models

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Using schema in models

mjgraham
Hi,

I have an XForm model with a schema:

<xforms:model schema="oxf:/schema/ConeSearch-v0.3.xsd">
...

and the rendered form has the error exclamation mark next to each input
box. If I put data in, the mark does not go away even though it is a
valid element.

Any ideas?

    Cheers,

    Matthew



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Using schema in models

clemens.harder
Hi Matthew,

 thats sounds like a wrong schema.

You have to pay attention to the xml:base Attribut, if you use
<xi:include href="input:data" /> for referencing an data in xforms
model. Maybe thats the problem.

ciao
clemens

Matthew Graham schrieb:

> Hi,
>
> I have an XForm model with a schema:
>
> <xforms:model schema="oxf:/schema/ConeSearch-v0.3.xsd">
> ...
>
> and the rendered form has the error exclamation mark next to each
> input box. If I put data in, the mark does not go away even though it
> is a valid element.
>
> Any ideas?
>
>    Cheers,
>
>    Matthew
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.3.3/296 - Release Date: 29.03.2006
>  



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Using schema in models

mjgraham
Hi,

No, the schema is fine; I am loading the schema and instance dynamically
via XSL though:

<xhtml:html xsl:version="2.0"...>
  <xhtml:head>
    <xsl:variable name="schema" select="/model/schema"/>
    <xforms:model schema="{$schema}">
      <xforms:instance id="instance">
        <xsl:copy-of select="/model/resource/*"/>
      </xforms:instance>

Could this be the problem?

    Cheers,

    Matthew

Clemens Harder wrote:

> Hi Matthew,
>
> thats sounds like a wrong schema.
>
> You have to pay attention to the xml:base Attribut, if you use
> <xi:include href="input:data" /> for referencing an data in xforms
> model. Maybe thats the problem.
>
> ciao
> clemens
>
> Matthew Graham schrieb:
>
>> Hi,
>>
>> I have an XForm model with a schema:
>>
>> <xforms:model schema="oxf:/schema/ConeSearch-v0.3.xsd">
>> ...
>>
>> and the rendered form has the error exclamation mark next to each
>> input box. If I put data in, the mark does not go away even though it
>> is a valid element.
>>
>> Any ideas?
>>
>>    Cheers,
>>
>>    Matthew
>>
>> ------------------------------------------------------------------------
>>
>>
>> --
>> You receive this message as a subscriber of the
>> [hidden email] mailing list.
>> To unsubscribe: mailto:[hidden email]
>> For general help: mailto:[hidden email]?subject=help
>> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>>  
>> ------------------------------------------------------------------------
>>
>> No virus found in this incoming message.
>> Checked by AVG Free Edition.
>> Version: 7.1.385 / Virus Database: 268.3.3/296 - Release Date:
>> 29.03.2006
>>  
>
>
>
>------------------------------------------------------------------------
>
>
>--
>You receive this message as a subscriber of the [hidden email] mailing list.
>To unsubscribe: mailto:[hidden email]
>For general help: mailto:[hidden email]?subject=help
>ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  
>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Using schema in models

Alessandro  Vernet
Administrator
On 3/30/06, Matthew Graham <[hidden email]> wrote:
> Hi,
>
> No, the schema is fine; I am loading the schema and instance dynamically
> via XSL though:
>
>     <xsl:variable name="schema" select="/model/schema"/>
>     <xforms:model schema="{$schema}">
>
> Could this be the problem?

/model/schema contains the URI of the schema, right? If this is the
case, then you should be fine. I guess we would need to have an
example that we can run in the XForms sandbox to be able to help
further.

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

Re: Using schema in models

mjgraham
Hi,

Yes, /model/schema contains the URI of the schema and I'm fairly happy
that this is loading OK. The instance that the schema is intended for  is:

<xforms:instance id="instance">
  <xsl:copy-of select="/model/resource/*"/>
</xforms:instance>

where /model/resource/* holds the instance data. Could this be the
problem? The form displays fine but just with error marks next to each
input. The workaround I have at the moment is to create bind controls
based on the schema but it would be much nicer just to have it validate
against the imported schema.

    Cheers,

    Matthew


Alessandro Vernet wrote:

>On 3/30/06, Matthew Graham <[hidden email]> wrote:
>  
>
>>Hi,
>>
>>No, the schema is fine; I am loading the schema and instance dynamically
>>via XSL though:
>>
>>    <xsl:variable name="schema" select="/model/schema"/>
>>    <xforms:model schema="{$schema}">
>>
>>Could this be the problem?
>>    
>>
>
>/model/schema contains the URI of the schema, right? If this is the
>case, then you should be fine. I guess we would need to have an
>example that we can run in the XForms sandbox to be able to help
>further.
>
>Alex
>--
>Blog (XML, Web apps, Open Source):
>http://www.orbeon.com/blog/
>



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Using schema in models

Alessandro  Vernet
Administrator
On 3/31/06, Matthew Graham <[hidden email]> wrote:
> Yes, /model/schema contains the URI of the schema and I'm fairly happy
> that this is loading OK. The instance that the schema is intended for  is:
>
> <xforms:instance id="instance">
>   <xsl:copy-of select="/model/resource/*"/>
> </xforms:instance>
>
> where /model/resource/* holds the instance data. Could this be the
> problem?

Hi Matthew,

I doubt that including the instance with XSLT this way could cause any
problem. I think it would really help if you were able to create an
example that exposes this problem and that we can run in the sandbox.

Alex
--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet
Reply | Threaded
Open this post in threaded view
|

RE: Using schema in models

Ryan Puddephatt
Matthew,
        Is the root for the instance resource? Or do you have a container
tag within that. This could be the problem if you don't have a
container/root tag for your instance it won't work.

Ryan Puddephatt
Software Engineer
TFX Group - IT UK
1 Michaelson Square
Livingston
West Lothian
Scotand
EH54 7DP
 
* [hidden email]
( 01506 407 110
7  01506 407 108
 

>-----Original Message-----
>From: [hidden email] [mailto:[hidden email]] On Behalf Of Alessandro
>Vernet
>Sent: 04 April 2006 02:18
>To: [hidden email]
>Subject: Re: [ops-users] Using schema in models
>
>On 3/31/06, Matthew Graham <[hidden email]> wrote:
>> Yes, /model/schema contains the URI of the schema and I'm fairly happy
>> that this is loading OK. The instance that the schema is intended for
>is:
>>
>> <xforms:instance id="instance">
>>   <xsl:copy-of select="/model/resource/*"/>
>> </xforms:instance>
>>
>> where /model/resource/* holds the instance data. Could this be the
>> problem?
>
>Hi Matthew,
>
>I doubt that including the instance with XSLT this way could cause any
>problem. I think it would really help if you were able to create an
>example that exposes this problem and that we can run in the sandbox.
>
>Alex
>--
>Blog (XML, Web apps, Open Source):
>http://www.orbeon.com/blog/




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Using schema in models

mjgraham
In reply to this post by Alessandro Vernet
Hi,

OK, I've reduced the problem down to enclosed test example: test2.xsd is
an extension of test1.xsd (test2.xsd imports test1.xsd) but it defines a
different namespace. test2.xsd is defined to be the schema in the model
for test.xhtml but the root element of the instance is in the namespace
of test1.xsd. In the displayed form, the element in the test1.xsd
namespace is fine but the element from the test2.xsd namespace shows the
error mark.

The page-flow.xml entry is:

   <page path-info="/publish/test" view="test.xhtml"/>

test1.xsd and test2.xsd reside in a subdirectory called 'schema' in the
parent directory to where test.xhtml resides.

    Cheers,

    Matthew

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.ivoa.net/xml/VORegistry/v0.3"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:vr="http://www.ivoa.net/xml/VOResource/v0.10"
           xmlns:vg="http://www.ivoa.net/xml/VORegistry/v0.3"
           elementFormDefault="qualified" attributeFormDefault="unqualified"
           version="0.3">

   <xs:import namespace="http://www.ivoa.net/xml/VOResource/v0.10"
              schemaLocation="../schema/test1.xsd"/>

   <xs:element name="Resource2" type="vg:Authority"/>

   <xs:complexType name="Authority">
      <xs:complexContent>
         <xs:extension base="vr:Resource">
            <xs:sequence>
               <xs:element name="managingOrg" type="xs:string"
                           minOccurs="0"/>
            </xs:sequence>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

</xs:schema>

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.ivoa.net/xml/VOResource/v0.10"
           xmlns="http://www.w3.org/2001/XMLSchema"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:vr="http://www.ivoa.net/xml/VOResource/v0.10"
           elementFormDefault="qualified"
           attributeFormDefault="unqualified"
           version="0.10">

   <xs:element name="Resource" type="vr:Resource"/>

   <xs:complexType name="Resource">
      <xs:sequence>
         <xs:element name="title" type="xs:string"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="Service">
      <xs:complexContent>
         <xs:extension base="vr:Resource">
            <xs:sequence>
               <xs:element name="interface" type="vr:Interface" minOccurs="1"
                                            maxOccurs="unbounded">
               </xs:element>
            </xs:sequence>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:complexType name="Interface" abstract="true">
      <xs:sequence>
         <xs:element name="accessURL" type="vr:AccessURL"/>
      </xs:sequence>
   </xs:complexType>

   <xs:complexType name="AccessURL">
     <xs:simpleContent>
       <xs:extension base="xs:anyURI">
         <xs:attribute name="use">
           <xs:simpleType>
             <xs:restriction base="xs:string">
               <xs:enumeration value="full"/>
               <xs:enumeration value="base"/>
               <xs:enumeration value="dir"/>
             </xs:restriction>
           </xs:simpleType>
         </xs:attribute>
       </xs:extension>
     </xs:simpleContent>
   </xs:complexType>
</xs:schema>


--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

test.xhtml (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Using schema in models

Alessandro  Vernet
Administrator
Hi Matthew,

Thank you for the test case. I was able to reproduce the problem and
added an entry for this in the tracker:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=304934&group_id=168&atid=350207

Alex

On 4/4/06, Matthew Graham <[hidden email]> wrote:

> Hi,
>
> OK, I've reduced the problem down to enclosed test example: test2.xsd is
> an extension of test1.xsd (test2.xsd imports test1.xsd) but it defines a
> different namespace. test2.xsd is defined to be the schema in the model
> for test.xhtml but the root element of the instance is in the namespace
> of test1.xsd. In the displayed form, the element in the test1.xsd
> namespace is fine but the element from the test2.xsd namespace shows the
> error mark.
>
> The page-flow.xml entry is:
>
>    <page path-info="/publish/test" view="test.xhtml"/>
>
> test1.xsd and test2.xsd reside in a subdirectory called 'schema' in the
> parent directory to where test.xhtml resides.
>
>     Cheers,
>
>     Matthew
>
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
>
>
>

--
Blog (XML, Web apps, Open Source):
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet