disable schema validation for an instance, or submit across models?

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

disable schema validation for an instance, or submit across models?

Pieter Hartog
For an xform, I have an instance that defines the structure of a search filter, and another instance that describes the main xml document structure.
When I click 'find', it submits the values from the filter instance to a search query and the result replaces the main xml structure that I want to validate.

I only need to validate (on input and submission) the main xml structure and I don't really care about validating the filter instance.
I want to validate using XML Schema.

Problem is that
1) the schema is defined on model level (and not on instance level)
2) I can't submit an instance from one model to replace an instance in another model - as far as I know
3) I can disable the validation on submit, but I still get errors in my error console for the validation errors on one of the instances.

Does anybody know a solution for this problem? Maybe there is a way to submit from one model and replace an instance in another model somehow?
Reply | Threaded
Open this post in threaded view
|

Re: disable schema validation an instance, or submit across models?

Steve Speicher
There are a few approaches to handling this.
-) Build an "umbrella" schema that includes other schemas such that your
model validates
-) Change your schema to make the content you have valid, by adding a global
element declaration of type 'any' for your search filter.
-) Perhaps obvious but not desirable, don't use your schema on the model.
Instead use model binds to attach types to the key nodes of your instance.

Steve

On Wed, Jul 9, 2008 at 4:24 PM, Pieter Hartog <[hidden email]>
wrote:

>
> For an xform, I have an instance that defines the structure of a search
> filter, and another instance that describes the main xml document
> structure.
> When I click 'find', it submits the values from the filter instance to a
> search query and the result replaces the main xml structure that I want to
> validate.
>
> I only need to validate (on input and submission) the main xml structure
> and
> I don't really care about validating the filter instance.
> I want to validate using XML Schema.
>
> Problem is that
> 1) the schema is defined on model level (and not on instance level)
> 2) I can't submit an instance from one model to replace an instance in
> another model - as far as I know
> 3) I can disable the validation on submit, but I still get errors in my
> error console for the validation errors on one of the instances.
>
> Does anybody know a solution for this problem? Maybe there is a way to
> submit from one model and replace an instance in another model somehow?
> --
> View this message in context:
> http://www.nabble.com/disable-schema-validation-an-instance%2C-or-submit-across-models--tp18370001p18370001.html
> Sent from the Mozilla - XForms mailing list archive at Nabble.com.
>
> _______________________________________________
> dev-tech-xforms mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-xforms
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: disable schema validation an instance, or submit across models?

Klotz, Leigh
The idea is that all data in one model would be described by a
consistent set of schemas, with at most one schema per namespace.  

If your schema is accurate for the query and the response, then the
queries should be valid in the schema.   If not, one option is to
separate the namespaces of the query and the response.  You can use
structure for the query and use types shared in the query and response.
You might not need any structure for the query, so you might not need a
separate schema for it.  (It ought to be the case that namespaces for
which there is no schema get no structural validation, but some
processors didn't do it this way, so we issued a clarification
recently.)

As Steve says, another option is to make a new schema which contains
just the simpleTypes from the original schema and leave the structure
out, and use bind to associates types from the library with nodes.

Leigh.

-----Original Message-----
From: dev-tech-xforms-bounces+leigh.klotz=[hidden email]
[mailto:dev-tech-xforms-bounces+leigh.klotz=[hidden email]]
On Behalf Of Steve Speicher
Sent: Thursday, July 10, 2008 4:41 AM
To: Pieter Hartog
Cc: [hidden email]
Subject: Re: disable schema validation an instance, or submit across
models?

There are a few approaches to handling this.
-) Build an "umbrella" schema that includes other schemas such that your
model validates
-) Change your schema to make the content you have valid, by adding a
global element declaration of type 'any' for your search filter.
-) Perhaps obvious but not desirable, don't use your schema on the
model.
Instead use model binds to attach types to the key nodes of your
instance.

Steve

On Wed, Jul 9, 2008 at 4:24 PM, Pieter Hartog
<[hidden email]>
wrote:

>
> For an xform, I have an instance that defines the structure of a
> search filter, and another instance that describes the main xml
> document structure.
> When I click 'find', it submits the values from the filter instance to

> a search query and the result replaces the main xml structure that I
> want to validate.
>
> I only need to validate (on input and submission) the main xml
> structure and I don't really care about validating the filter
> instance.
> I want to validate using XML Schema.
>
> Problem is that
> 1) the schema is defined on model level (and not on instance level)
> 2) I can't submit an instance from one model to replace an instance in

> another model - as far as I know
> 3) I can disable the validation on submit, but I still get errors in
> my error console for the validation errors on one of the instances.
>
> Does anybody know a solution for this problem? Maybe there is a way to

> submit from one model and replace an instance in another model
somehow?

> --
> View this message in context:
> http://www.nabble.com/disable-schema-validation-an-instance%2C-or-subm
> it-across-models--tp18370001p18370001.html
> Sent from the Mozilla - XForms mailing list archive at Nabble.com.
>
> _______________________________________________
> dev-tech-xforms mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-xforms
>
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: disable schema validation an instance, or submit across models?

Pieter Hartog
This is really good advice Steve and Leigh. Perhaps obvious to you, but this is the kind of stuff I was not sure on how to approach it best.

I went for the 'umbrella' schema approach and it works great.

The binding of complex types to the root elements of an instance would be nice too, but I read somewhere that complex type validation not supported yet, so I did not go there.

Thank you!
Pieter

Klotz, Leigh wrote
The idea is that all data in one model would be described by a
consistent set of schemas, with at most one schema per namespace.  

If your schema is accurate for the query and the response, then the
queries should be valid in the schema.   If not, one option is to
separate the namespaces of the query and the response.  You can use
structure for the query and use types shared in the query and response.
You might not need any structure for the query, so you might not need a
separate schema for it.  (It ought to be the case that namespaces for
which there is no schema get no structural validation, but some
processors didn't do it this way, so we issued a clarification
recently.)

As Steve says, another option is to make a new schema which contains
just the simpleTypes from the original schema and leave the structure
out, and use bind to associates types from the library with nodes.

Leigh.

-----Original Message-----
From: dev-tech-xforms-bounces+leigh.klotz=xerox.com@lists.mozilla.org
[mailto:dev-tech-xforms-bounces+leigh.klotz=xerox.com@lists.mozilla.org]
On Behalf Of Steve Speicher
Sent: Thursday, July 10, 2008 4:41 AM
To: Pieter Hartog
Cc: dev-tech-xforms@lists.mozilla.org
Subject: Re: disable schema validation an instance, or submit across
models?

There are a few approaches to handling this.
-) Build an "umbrella" schema that includes other schemas such that your
model validates
-) Change your schema to make the content you have valid, by adding a
global element declaration of type 'any' for your search filter.
-) Perhaps obvious but not desirable, don't use your schema on the
model.
Instead use model binds to attach types to the key nodes of your
instance.

Steve

On Wed, Jul 9, 2008 at 4:24 PM, Pieter Hartog
<pieter@fouroaksconsulting.com>
wrote:

>
> For an xform, I have an instance that defines the structure of a
> search filter, and another instance that describes the main xml
> document structure.
> When I click 'find', it submits the values from the filter instance to

> a search query and the result replaces the main xml structure that I
> want to validate.
>
> I only need to validate (on input and submission) the main xml
> structure and I don't really care about validating the filter
> instance.
> I want to validate using XML Schema.
>
> Problem is that
> 1) the schema is defined on model level (and not on instance level)
> 2) I can't submit an instance from one model to replace an instance in

> another model - as far as I know
> 3) I can disable the validation on submit, but I still get errors in
> my error console for the validation errors on one of the instances.
>
> Does anybody know a solution for this problem? Maybe there is a way to

> submit from one model and replace an instance in another model
somehow?
> --
> View this message in context:
> http://www.nabble.com/disable-schema-validation-an-instance%2C-or-subm
> it-across-models--tp18370001p18370001.html
> Sent from the Mozilla - XForms mailing list archive at Nabble.com.
>
> _______________________________________________
> dev-tech-xforms mailing list
> dev-tech-xforms@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-tech-xforms
>
_______________________________________________
dev-tech-xforms mailing list
dev-tech-xforms@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
dev-tech-xforms@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-xforms
Reply | Threaded
Open this post in threaded view
|

RE: disable schema validation an instance, or submit across models?

Klotz, Leigh
I'm glad you got it to work!

bind/@type can't be used to attach complex types to nodes, only simple
types, by the spec; this is unlikely to change.
Maybe in XForms 1.2 or 2.0 there will be support for RelaxNG schema and
the schema stuff will get more general, but more generic structure
(other than merely assigning a full Schema set to a model) probably
won't be done with bind/@type.
Leigh.

-----Original Message-----
From: dev-tech-xforms-bounces+leigh.klotz=[hidden email]
[mailto:dev-tech-xforms-bounces+leigh.klotz=[hidden email]]
On Behalf Of Pieter Hartog
Sent: Friday, July 11, 2008 7:37 AM
To: [hidden email]
Subject: RE: disable schema validation an instance, or submit across
models?


This is really good advice Steve and Leigh. Perhaps obvious to you, but
this is the kind of stuff I was not sure on how to approach it best.

I went for the 'umbrella' schema approach and it works great.

The binding of complex types to the root elements of an instance would
be nice too, but I read somewhere that complex type validation not
supported yet, so I did not go there.

Thank you!
Pieter


Klotz, Leigh wrote:
>
> The idea is that all data in one model would be described by a
> consistent set of schemas, with at most one schema per namespace.
>
> If your schema is accurate for the query and the response, then the
> queries should be valid in the schema.   If not, one option is to
> separate the namespaces of the query and the response.  You can use
> structure for the query and use types shared in the query and
response.

> You might not need any structure for the query, so you might not need
> a separate schema for it.  (It ought to be the case that namespaces
> for which there is no schema get no structural validation, but some
> processors didn't do it this way, so we issued a clarification
> recently.)
>
> As Steve says, another option is to make a new schema which contains
> just the simpleTypes from the original schema and leave the structure
> out, and use bind to associates types from the library with nodes.
>
> Leigh.
>
> -----Original Message-----
> From: dev-tech-xforms-bounces+leigh.klotz=[hidden email]
> [mailto:dev-tech-xforms-bounces+leigh.klotz=[hidden email]
> g]
> On Behalf Of Steve Speicher
> Sent: Thursday, July 10, 2008 4:41 AM
> To: Pieter Hartog
> Cc: [hidden email]
> Subject: Re: disable schema validation an instance, or submit across
> models?
>
> There are a few approaches to handling this.
> -) Build an "umbrella" schema that includes other schemas such that
> your model validates
> -) Change your schema to make the content you have valid, by adding a
> global element declaration of type 'any' for your search filter.
> -) Perhaps obvious but not desirable, don't use your schema on the
> model.
> Instead use model binds to attach types to the key nodes of your
> instance.
>
> Steve
>
> On Wed, Jul 9, 2008 at 4:24 PM, Pieter Hartog
> <[hidden email]>
> wrote:
>
>>
>> For an xform, I have an instance that defines the structure of a
>> search filter, and another instance that describes the main xml
>> document structure.
>> When I click 'find', it submits the values from the filter instance
>> to
>
>> a search query and the result replaces the main xml structure that I
>> want to validate.
>>
>> I only need to validate (on input and submission) the main xml
>> structure and I don't really care about validating the filter
>> instance.
>> I want to validate using XML Schema.
>>
>> Problem is that
>> 1) the schema is defined on model level (and not on instance level)
>> 2) I can't submit an instance from one model to replace an instance
>> in
>
>> another model - as far as I know
>> 3) I can disable the validation on submit, but I still get errors in
>> my error console for the validation errors on one of the instances.
>>
>> Does anybody know a solution for this problem? Maybe there is a way
>> to
>
>> submit from one model and replace an instance in another model
> somehow?
>> --
>> View this message in context:
>> http://www.nabble.com/disable-schema-validation-an-instance%2C-or-sub
>> m it-across-models--tp18370001p18370001.html
>> Sent from the Mozilla - XForms mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> dev-tech-xforms mailing list
>> [hidden email]
>> https://lists.mozilla.org/listinfo/dev-tech-xforms
>>
> _______________________________________________
> dev-tech-xforms mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-xforms
> _______________________________________________
> dev-tech-xforms mailing list
> [hidden email]
> https://lists.mozilla.org/listinfo/dev-tech-xforms
>
>

--
View this message in context:
http://www.nabble.com/disable-schema-validation-for-an-instance%2C-or-su
bmit-across-models--tp18370001p18405361.html
Sent from the Mozilla - XForms mailing list archive at Nabble.com.

_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms
_______________________________________________
dev-tech-xforms mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xforms