You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by chodnik <wx...@o2.pl> on 2009/11/10 23:51:27 UTC

PSVI for attributes

I have an in memory DOM document with PSVI support. The problem is that after
validation PSVI is set for all elements but getAttributeDeclaration from
AttributePSVI returns null. I have tryed to validate all document, an
element with attribute and the attribute but the result is the same. Should
I do something specific to have PSVI for attribute node?
Thank in advance for any suggestions.
-- 
View this message in context: http://old.nabble.com/PSVI-for-attributes-tp26292805p26292805.html
Sent from the Xerces - J - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: PSVI for attributes

Posted by chodnik <wx...@o2.pl>.
Thank you Michael. I have found I was using
String name = attrDeclaration.getTypeDefinition().getName();
String namespace = attrDeclaration.getTypeDefinition().getNamespace();
instead
String name = attrDeclaration.getName();
String namespace = attrDeclaration.getNamespace();

This values was used to create attribute and it was a cause of the problem.
I have discovered this mistake  reading your comment to XERCESJ-1387 issue.
My ErrorHandler does not output messages because there are too many errors
creating document from scratch and it was a reason I didn't notice it.


Michael Glavassevich-3 wrote:
> 
> 
> What method are you using to create the attribute nodes? You must use
> createAttributeNS() or setAttributeNS() even for attributes with no
> namespace. The "non-NS" methods create (DOM Level 1) non-namespace-aware
> nodes which have no local name and cannot be used as input to a schema
> validator or any other namespace-aware processor.
> 
> Thanks.
> 
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
> 
> chodnik <wx...@o2.pl> wrote on 11/11/2009 04:44:30 AM:
> 
>> I am creating the document form a schema on the fly so I am sure the
> schema
>> is valid. The attribute is created after reading its declaration from
>> schema. I use the getAttributeUses method on the owner element. The only
>> thing is that a whole document is not valid because at the time of
>> validation it is not complete. But I don't think this is realy nessesery
>> because I have the element's PSVI even though the document is incomplet
> and
>> then invalid at all.
>>
>>
>> Michael Glavassevich-3 wrote:
>> >
>> > Did you check that your document and schema are actually valid and that
>> > there are declarations in the schema for the attributes that you're
>> > looking
>> > at?
>> >
>> > Michael Glavassevich
>> > XML Parser Development
>> > IBM Toronto Lab
>> > E-mail: mrglavas@ca.ibm.com
>> > E-mail: mrglavas@apache.org
>> >
>> > chodnik <wx...@o2.pl> wrote on 11/10/2009 05:51:27 PM:
>> >
>> >> I have an in memory DOM document with PSVI support. The problem is
> that
>> > after
>> >> validation PSVI is set for all elements but getAttributeDeclaration
> from
>> >> AttributePSVI returns null. I have tryed to validate all document, an
>> >> element with attribute and the attribute but the result is the same.
>> > Should
>> >> I do something specific to have PSVI for attribute node?
>> >> Thank in advance for any suggestions.
>> >> --
>> >> View this message in context: http://old.nabble.com/PSVI-for-
>> >> attributes-tp26292805p26292805.html
>> >> Sent from the Xerces - J - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
>> >> For additional commands, e-mail: j-users-help@xerces.apache.org
>> >
>>
>> --
>> View this message in context: http://old.nabble.com/PSVI-for-
>> attributes-tp26292805p26298462.html
>> Sent from the Xerces - J - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
>> For additional commands, e-mail: j-users-help@xerces.apache.org
> 

-- 
View this message in context: http://old.nabble.com/PSVI-for-attributes-tp26292805p26315076.html
Sent from the Xerces - J - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: PSVI for attributes

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
What method are you using to create the attribute nodes? You must use
createAttributeNS() or setAttributeNS() even for attributes with no
namespace. The "non-NS" methods create (DOM Level 1) non-namespace-aware
nodes which have no local name and cannot be used as input to a schema
validator or any other namespace-aware processor.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

chodnik <wx...@o2.pl> wrote on 11/11/2009 04:44:30 AM:

> I am creating the document form a schema on the fly so I am sure the
schema
> is valid. The attribute is created after reading its declaration from
> schema. I use the getAttributeUses method on the owner element. The only
> thing is that a whole document is not valid because at the time of
> validation it is not complete. But I don't think this is realy nessesery
> because I have the element's PSVI even though the document is incomplet
and
> then invalid at all.
>
>
> Michael Glavassevich-3 wrote:
> >
> > Did you check that your document and schema are actually valid and that
> > there are declarations in the schema for the attributes that you're
> > looking
> > at?
> >
> > Michael Glavassevich
> > XML Parser Development
> > IBM Toronto Lab
> > E-mail: mrglavas@ca.ibm.com
> > E-mail: mrglavas@apache.org
> >
> > chodnik <wx...@o2.pl> wrote on 11/10/2009 05:51:27 PM:
> >
> >> I have an in memory DOM document with PSVI support. The problem is
that
> > after
> >> validation PSVI is set for all elements but getAttributeDeclaration
from
> >> AttributePSVI returns null. I have tryed to validate all document, an
> >> element with attribute and the attribute but the result is the same.
> > Should
> >> I do something specific to have PSVI for attribute node?
> >> Thank in advance for any suggestions.
> >> --
> >> View this message in context: http://old.nabble.com/PSVI-for-
> >> attributes-tp26292805p26292805.html
> >> Sent from the Xerces - J - Users mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> >> For additional commands, e-mail: j-users-help@xerces.apache.org
> >
>
> --
> View this message in context: http://old.nabble.com/PSVI-for-
> attributes-tp26292805p26298462.html
> Sent from the Xerces - J - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org

Re: PSVI for attributes

Posted by chodnik <wx...@o2.pl>.
I am creating the document form a schema on the fly so I am sure the schema
is valid. The attribute is created after reading its declaration from
schema. I use the getAttributeUses method on the owner element. The only
thing is that a whole document is not valid because at the time of
validation it is not complete. But I don't think this is realy nessesery
because I have the element's PSVI even though the document is incomplet and
then invalid at all.


Michael Glavassevich-3 wrote:
> 
> Did you check that your document and schema are actually valid and that
> there are declarations in the schema for the attributes that you're
> looking
> at?
> 
> Michael Glavassevich
> XML Parser Development
> IBM Toronto Lab
> E-mail: mrglavas@ca.ibm.com
> E-mail: mrglavas@apache.org
> 
> chodnik <wx...@o2.pl> wrote on 11/10/2009 05:51:27 PM:
> 
>> I have an in memory DOM document with PSVI support. The problem is that
> after
>> validation PSVI is set for all elements but getAttributeDeclaration from
>> AttributePSVI returns null. I have tryed to validate all document, an
>> element with attribute and the attribute but the result is the same.
> Should
>> I do something specific to have PSVI for attribute node?
>> Thank in advance for any suggestions.
>> --
>> View this message in context: http://old.nabble.com/PSVI-for-
>> attributes-tp26292805p26292805.html
>> Sent from the Xerces - J - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
>> For additional commands, e-mail: j-users-help@xerces.apache.org
> 

-- 
View this message in context: http://old.nabble.com/PSVI-for-attributes-tp26292805p26298462.html
Sent from the Xerces - J - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org


Re: PSVI for attributes

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Did you check that your document and schema are actually valid and that
there are declarations in the schema for the attributes that you're looking
at?

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

chodnik <wx...@o2.pl> wrote on 11/10/2009 05:51:27 PM:

> I have an in memory DOM document with PSVI support. The problem is that
after
> validation PSVI is set for all elements but getAttributeDeclaration from
> AttributePSVI returns null. I have tryed to validate all document, an
> element with attribute and the attribute but the result is the same.
Should
> I do something specific to have PSVI for attribute node?
> Thank in advance for any suggestions.
> --
> View this message in context: http://old.nabble.com/PSVI-for-
> attributes-tp26292805p26292805.html
> Sent from the Xerces - J - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
> For additional commands, e-mail: j-users-help@xerces.apache.org