yana,
let me clarify. I was able to validate the
schema using a netbeans utility. i was only able to validate the xml
document using a website so i could pass in the schema to validate
against. it still returns a false when trying to validate using
pc.validate() (see code in my previous post about what variable pc
is).
In response to using the document type to
parse...
I have a MDADocument class but i don't
know if i can access the planningcontextheadertype through that. i will
dig a bit deeper to see if i can find it.
Jason
From: Yana Kadiyska [mailto:[EMAIL PROTECTED] Sent: Thursday, September 29, 2005 11:09 AM To: dev@xmlbeans.apache.org Subject: RE: NEED XMLBEANS HELP!!! You should be using the
document type to parse a document, i.e. PlanningContextHeaderTypeDocument.Factory.parse(inputFile);
instead of what you
have (the type of the root element). are you saying that calling pc.validate()
returns true after your call – that would be
concerning… If that doesn’t solve
your issue, let me know – I understand that you might not be free to share the
whole schema, but we should be able to figure it out based on what you
sent. -Yana From: Green,
Jason M. [mailto:[EMAIL PROTECTED] Okay, I have
gotten the updated schema and i can validate that. I do know that if i try
to validate the xml vs the standards it fails. but if i try to validate
based against the schema it validates fine. I will give you a portion of
the schema (enough that it should be clear if i am doing something
wrong) <?xml version="1.0"
encoding="UTF-8"?> <xs:complexType
name="PlanningContextHeaderType">
</xs:annotation> </xs:schema> Here's my code
again: import
java.io.File; public class
parse
PlanningContextHeaderType pc =
PlanningContextHeaderType.Factory.parse(inputFile);
}
catch(org.apache.xmlbeans.XmlException
e)
} } and here is the portion
of the xml document <?xml version="1.0"
encoding="UTF-8"?>
So does anyone know why
am i getting the null pointer exception when i print out the oplan
name? Jason From: Yana
Kadiyska [mailto:[EMAIL PROTECTED] People do exist on this
mailing list J I will try to address
the second part of your email. Have you tried calling
the validate method with an error listener after you parse in the instance? I
think the code you have should work (and I’m saying that without seeing the
schema you have) in theory. The thing that I’m guessing is that the instance is
somehow not valid, so OPLAN element is not recognized as such because it’s in a
different namespace than the schema requires it to be in (I’m assuming that the
NPE occurs on oplan.getName()
). Sorry if this is not helpful, that’s
the best I can do without looking at the actual schema. From: Green,
Jason M. [mailto:[EMAIL PROTECTED] If
anyone is out there listening…. I
just got an extensive xml schema that I used xmlbeans to create a jar
with. The large number of files confuses me, but that isn't the basis of
my email. First, Second, <?xml version="1.0"
encoding="UTF-8"?> I'll keep it at that for right now,
but I have a couple more questions but I won't bother to write it until I hear
back that people actually exist in this mailing
list. Thanks, |
Title: NEED XMLBEANS HELP!!!
- NEED XMLBEANS HELP!!! Green, Jason M.
- RE: NEED XMLBEANS HELP!!! Yana Kadiyska
- RE: NEED XMLBEANS HELP!!! Green, Jason M.
- RE: NEED XMLBEANS HELP!!! Green, Jason M.
- RE: NEED XMLBEANS HELP!!! Yana Kadiyska
- RE: NEED XMLBEANS HELP!!! Green, Jason M.
- Re: NEED XMLBEANS HELP!!! Robin Sander
- RE: NEED XMLBEANS HELP!!! Green, Jason M.
- RE: NEED XMLBEANS HELP!!! Green, Jason M.
- RE: NEED XMLBEANS HELP!!! Green, Jason M.
- RE: NEED XMLBEANS HELP!!! Radu Preotiuc-Pietro
- RE: NEED XMLBEANS HELP!!! Green, Jason M.
- RE: NEED XMLBEANS HELP!!! Don Stewart
- RE: NEED XMLBEANS HELP!!! Green, Jason M.
- RE: NEED XMLBEANS HELP!!! Don Stewart
- RE: NEED XMLBEANS HELP!!! Don Stewart