Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Namespace issue with validate_schema?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jonathan Bartels  
View profile  
 More options Jan 2 2009, 11:16 am
From: Jonathan Bartels <Jonathan.Bart...@gmail.com>
Date: Fri, 2 Jan 2009 08:16:29 -0800 (PST)
Local: Fri, Jan 2 2009 11:16 am
Subject: [libxml-devel] Namespace issue with validate_schema?
This is likely a PEBKAC issue rather than a bug. I hope I'm submitting
to the right list.

I'm getting different validation results from libxml in Ruby than I am
from a command-line tool (xmllint). I'm using a schema definition from
ASTM to validate the output, for what it cost me the schema should be
correct. I'm using libxml 0.9.4.

The XML I'm validating is:
**************
<?xml version="1.0"?>
<ContinuityOfCareRecord xmlns="urn:astm-org:CCR" xmlns:xsi="http://
www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:astm-
org:CCR CCR1.0.xsd">
  <CCRDocumentObjectID>a4941200-bb14-012b-4b05-001a6b46d85c</
CCRDocumentObjectID>
  <Language>
    <Text>English</Text>
  </Language>
  <Version>V1.0</Version>
  <DateTime>
    <ExactDateTime>2009-01-02T11:02:13-05:00</ExactDateTime>
  </DateTime>
</ContinuityOfCareRecord>
*************

The code and output from libxml is:
**************
 schema_doc = XML::Document.file("#{RAILS_ROOT}/ADJE2369.18405.xml")
 schema = XML::Schema.document(schema_doc)

@@ccr.validate_schema(schema)
Error: Element 'CCRDocumentObjectID': This element is not expected.
Expected is ( {urn:astm-org:CCR}CCRDocumentObjectID ). at :0.
LibXML::XML::Error: Error: Element 'CCRDocumentObjectID': This element
is not expected. Expected is ( {urn:astm-org:CCR}
CCRDocumentObjectID ). at :0.
        from /home/jon/EXTENSION/Core/branches/TrustBearer/lib/ccr.rb:86:in
`validate_schema'
        from /home/jon/EXTENSION/Core/branches/TrustBearer/lib/ccr.rb:86:in
`validate'
        from (irb):1
************

The command and output from xmllint is:
*******
jon@TPX-70002:~$ xmllint --schema ~/Documents/books\ \&\ guides/CCR/
ADJE2369.18405.xml ./test_ccr.xml

./test_ccr.xml:2: element ContinuityOfCareRecord: Schemas validity
error : Element '{urn:astm-org:CCR}ContinuityOfCareRecord': Missing
child element(s). Expected is ( {urn:astm-org:CCR}Patient ).
./test_ccr.xml fails to validate
*************

I expect a failure, since I haven't added a required node yet
(Patient), but I'm trying to reconcile the discrepancy between xmllint
and libxml.

I believe the namespace declaration in the root node is correct, I
would expect since xmlns="urn:astm-org:CCR" is declared that it would
be used on the root node and all children.

Is this a usage error on my part? Am I misusing libxml or is the xml
incorrect?

If this is a bug, has it been patched? If not, what information can I
provide to help get it fixed?

Thanks for your help and thanks for creating and publishing libxml for
Ruby!

_______________________________________________
libxml-devel mailing list
libxml-de...@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Charlie Savage  
View profile  
 More options Jan 7 2009, 4:11 pm
From: Charlie Savage <c...@savagexi.com>
Date: Wed, 07 Jan 2009 14:11:59 -0700
Local: Wed, Jan 7 2009 4:11 pm
Subject: Re: [libxml-devel] Namespace issue with validate_schema?

> This is likely a PEBKAC issue rather than a bug. I hope I'm submitting
> to the right list.

> I'm getting different validation results from libxml in Ruby than I am
> from a command-line tool (xmllint). I'm using a schema definition from
> ASTM to validate the output, for what it cost me the schema should be
> correct. I'm using libxml 0.9.4.

> I expect a failure, since I haven't added a required node yet
> (Patient), but I'm trying to reconcile the discrepancy between xmllint
> and libxml.

Yeah, that sure is interesting. My first thought is if libxml-ruby is
using the same version of libmxl that xmllint is using?  Is this on
Windows, Linux, OS X or some other OS?

> Is this a usage error on my part? Am I misusing libxml or is the xml
> incorrect?

> If this is a bug, has it been patched? If not, what information can I
> provide to help get it fixed?

I see the xml you are validating, but can you provide the schema?  Mind
submitting a bug report at ruby forge?

http://rubyforge.org/tracker/?group_id=494

Charlie

  smime.p7s
4K Download

_______________________________________________
libxml-devel mailing list
libxml-de...@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Bartels  
View profile  
 More options Jan 8 2009, 9:43 am
From: Jonathan Bartels <Jonathan.Bart...@gmail.com>
Date: Thu, 8 Jan 2009 06:43:57 -0800 (PST)
Local: Thurs, Jan 8 2009 9:43 am
Subject: Re: [libxml-devel] Namespace issue with validate_schema?

> Yeah, that sure is interesting. My first thought is if libxml-ruby is
> using the same version of libmxl that xmllint is using?  Is this on
> Windows, Linux, OS X or some other OS?

This is on Ubuntu 8.04, dpkg reports the following for libxml:
libxml1 1:1.8.17-14.1
libxml2 2.6.31.dfsg-2ubuntu1.3

> I see the xml you are validating, but can you provide the schema?  Mind
> submitting a bug report at ruby forge?

Legally, I cannot submit the schema. It is the ASTM CCR standard
(E2369–05). Access is fee based and the schema is not redistributable.
I may be able to post snippets as part of debugging things.

I'll file a bug report later today and follow it. Given that I can't
submit the schema I'll attempt to do some debugging/testing/patching
myself. Ideally I'd be able to reproduce it with a much simpler use
case than this particular XML standard.
_______________________________________________
libxml-devel mailing list
libxml-de...@rubyforge.org
http://rubyforge.org/mailman/listinfo/libxml-devel

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »