Validating XML Parser
We want to validate XML Messages generated by UDS 5.1 components against XSchemas before we send them out.
Forte 3.5. built in parser does no validation.
Has anybody set up a solution architecture he/she will share with us ? ( We do NOT have an AppServer in place !).
Solutions on UNIX platform preferred.
Thanks for each hint !
We have implemented a validating XML parser that does not require command line execution but unfortunately it depends on the Microsoft MSXML parser. We used olegen to create a Forte project that allows us to reference the MSXML parser as if it were inline Forte TOOL code. The MSXML4.dll provides support for validating XML schemas.
We are looking to find a multi-platform way to accomplish the same thing. I'm guessing that there may be a validating XML parser out there implemented in C that can be included into the Forte repository using the wrapper mechanism - has anyone tried this?
I see that Xerces has a C++ based validating parser - do you thing that could be accessed via the wrapper? Or would that have to be accessed via the command line?
Regards.
Similar Messages
-
Validating XML parser for J2ME?
Hello,
does anybody know a validating XML parser for J2ME?
Thanks
VolkerI mean the XML parser.
I want to know if there are XML parsers which can validate a XML document against a DTD or Schema
Thanks
Volker -
RE: Validating XML message...
Actually I stand corrected. XML Spy does seem to provide an OLE API to XML
validation ( the isValid method on the IDocument class ) although I haven't
tested it yet.
In my previous post I was thinking of another XML product I tested earlier
in the week which did not.
-----Original Message-----
From: Shaughnessy, Kevin
Sent: Friday, April 20, 2001 08:59
To: 'Rumen Georgiev'
Cc: [email protected]
Subject: RE: Validating XML message...
Rumen,
One idea that is possible is to use an OLE interface to a 3rd party XML
product. This assumes your logic which needs to validate is running on a
Windows box. But if so, it may work. Many products have type libraries which
can be run through OLEGen to create Forte classes. Then you can use TOOL to
talk OLE to that product.
For example, XML Spy 3.5 has a type library from which I created a Forte
project. Unfortunately this product didn't offer any extra features than
Forte's XMLParser ( i.e. the API didn't allow me to validate the XML ) so I
am back to using Forte's parser until I can test another product. If you
find one that does what you want let me know.
I've used OLE a lot with Forte to get functionality from other products (
VISIO, MS Office ) that Forte doesn't provide and it works well. Its a
platform dependent solution but one that may work for you.
Kevin
-----Original Message-----
From: Rumen Georgiev [mailto:[email protected]]
Sent: Friday, April 20, 2001 07:21
To: [email protected]
Cc: [email protected]
Subject: RE: Validating XML message...
Hi Kevin,
From the answers I've got it seems Forte parser is anon-validating one. So we have to look for an external
tool to validate these messages. What I am concerned
about is the integration with Forte.
Thanks for your help!
Rumen
Rumen,
From Tech Note 11811:
"ParserFactory.makeParser() will return a default,
non-validating XML parser."
My experience is that Forte's default XML parser will
not validate but will throw an exception if the XML
document is not well formed. I'm using the DOM
model and this exception happens on the
Document.importDocument( ) method.
If you want anything more than that you'll have to do
it externally.
Kevin-----Original Message-----
From: Rumen Georgiev [mailto:[email protected]]
Sent: Thursday, April 19, 2001 11:49 AM
To: [email protected]
Subject: Validating XML message...
We have to validate inbound XML messages before
processing them. The guys on the other side are
following XMLSchema recommendations to create their
messages using xsd file for validation. We plan to
use XMLParser Forte library and as far as I know it
validates against dtd file (haven't tried yet). If
this is true we have two options:
1. Find a program to convert xsd into dtd file and
use Forte XMLParser for validation.
2. Validate the message beforehand with an external
tool. That means integration between Forte and this
tool.
I would appreciate any help with either approach. Do
you know of a program doing xsd into dtd? Have you
used any existing tool on the market to validate
using XMLSchema? Or may be there is another solution
to
this?
Thank you in advance,
Rumen
=====
Rumen Georgiev
Forte Developer
EXE Technologies
(610) 872-4400 Ext.222
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/Hi,
there is some change in the XMLSPy4.3/XMLType Library 1.2 :
Validation
One common task on documents is to validate them against an assigned schema or DTD. If the XML file has no schema or DTD already assigned, use "Document.AssignSchema" or "Document.AssignDTD" to add the necessary references to the document.
Examples:
objSpy.ActiveDocument.AssignSchema "C:\mySchema.xsd", False
or
objSpy.ActiveDocument.AssignDTD "C:\myDTD.dtd", False
If you want the user to select a schema or DTD, pass True as the second parameter to these functions to display a file-dialog. These methods only put the reference into the document and do not check the existence of the specified file. If the file path is not valid, the validation will fail.
After you have assigned a valid schema or DTD reference to your file, you are able to validate it with "Document.IsValid". IsValid needs some out-parameters that must be declared as VARIANTs to be accessible from script languages like VBScript and JavaScript. -
Fatal error XML-0121 in a valid XML file in v2 of SAX parser
Attachments: "1|type=text/plain|desc=Logging of Fatal error using v2 of SAX parser |file=v2_loggin
.txt|";"2|type=text/plain|desc=Logging of Fatal error using v2 of java SAX parser |17078|file=v2_l
gging.txt|"
Dear XML team,
I am using the SAX parser version 2.0.2.4. When parsing a valid
XML of approx. 3,5 Megabytes i get a fatal error XML-0121
saying 'End tag does not match start tag
<CORRESPONDENTIENAAM1>...'
We checked the xml on the well formedness with tools like XML
Spy and IE5. The XML is valid!
We did some testing on the XML with the SAXSample class and we
noticed that the error is related to the use of Entity
References. When we removed the Entity Reference ' the XML
was parsed correctly.
We also noticed that if we cut the XML in two smaller parts it
was also parsed correctly.
I attached the output of the parser, as well as the output of
the SAXSample class.
I hope you can fix this problem!
With kind regards,
Rolf van Deursen.
nullUpdate: I have attempted to use xmlparserv2.jar dated 12/23/08 that is packaged with jDeveloper 11g preview, but am still receiving the same message.
-
XML Parser Message: Element series is not valid for the content model
Hello,
I work with FrameMaker 8 and DITA.
I change the element prodinfo in the topic.edd from:
General rule: (prodname), (vrmlist), (brand | series | platform | prognum | featnum | component)*
to:
General rule: (brand | series | platform | component)*
When I import the element definition to the template everything is okay.
When I insert the elements metadata, prodinfo, brand, series, platform and component into a topic I get the XML Parser Message that the element brand is not valid for the content model (prodname,vrmlist, ((brand|series|platform|prognum|featnum|component))*).
When I delete the element brand in the topic I get the XML Parser Message that the element series is not valid for the content model (prodname,vrmlist, ((brand|series|platform|prognum|featnum|component))*).
I change the element prodinfo in the topic.edd to:
General rule: (brand)?, (series)?, (platform)?, (component)?
...and get the same Parser Message.
I do not understand that. Is not it allowed to change the EDD this way without changing the DTD?
With kind regards
NinaHi Nina...<br /><br />In general, the EDD and DTD need to sync up. You can remove elements from an EDD element definition's general rule, as long as the resulting elements are still valid to the DTD. But if changing a general rule creates an invalid structure, you'll need to also change the DTD to allow the revised structure.<br /><br />With DITA, it is common to remove inline elements from block-level elements. For example, you might want to remove the <msgblock>, <msgnum>, and <msgph> elements from the general rule of the <p> element .. this can be done easily in the EDD and the resulting structure remains valid with the DTD.<br /><br />However, what you're doing leaves the <brand> element as a child of <prodinfo> .. which is invalid. You'll get these errors when saving a file, since this is when the file is validated against the DTD.<br /><br />I do not recommend modifying the structure in such a way that requires you to modify the DTD. If you really need to do this, then you should consider making a specialization to support your revised model.<br /><br />I hope this helps.<br /><br />Cheers and Happy New Year!<br /><br />...scott
-
Does Oracle XML Parser support Content Validation
Hi there,
Could someone out there give me a hint on whether the Oracle XML Parser has the capability of handling Content Validation? If yes, what's the mechanism behind it?
From my understanding of the Oracle XML Parser, even with the validating mode turned on, the parser only validates the XML data against the DTD (if any), which involves checking whether or not the attribute names and element tags are legal, whether nested elements belong to where they are, and so on. But I dont see any Content Validation. And my guess is that this feature, namely Content Validation, is simply not supported in the current version of the Oracle XML Parser. Am I right?
Any suggestion would be greatly appreciated. Thanks.
---Denali
nullHi there,
Could someone out there give me a hint on whether the Oracle XML Parser has the capability of handling Content Validation? If yes, what's the mechanism behind it?
From my understanding of the Oracle XML Parser, even with the validating mode turned on, the parser only validates the XML data against the DTD (if any), which involves checking whether or not the attribute names and element tags are legal, whether nested elements belong to where they are, and so on. But I dont see any Content Validation. And my guess is that this feature, namely Content Validation, is simply not supported in the current version of the Oracle XML Parser. Am I right?
Any suggestion would be greatly appreciated. Thanks.
---Denali
null -
XML parser validation and startup class
When I try to run run jCOM bridge like a startup class, I have the following error:
*** Loading bridge; Please wait ***
*** Bridge loaded successfully ***
Looking for BEA WebLogic 6.1 license...
Warning: validation was turned on but an org.xml.sax.ErrorHandler was not
set, which is probably not what is desired. Parser will use a default
ErrorHandler to print the first 10 errors. Please call
the 'setErrorHandler' method to fix this.
Error: URI=file:d:/bea61sp1/registry.xml Line=3: Element type "bea-product-infor
mation" is not declared in the dtd or schema.
Error: URI=file:d:/bea61sp1/registry.xml Line=4: Element type "host" is not decl
ared in the dtd or schema.
Error: URI=file:d:/bea61sp1/registry.xml Line=5: Element type "product" is not
d
eclared in the dtd or schema.
Error: URI=file:d:/bea61sp1/registry.xml Line=6: Element type "release" is not
d
eclared in the dtd or schema.
Error: URI=file:d:/bea61sp1/registry.xml Line=7: Element type "component" is not
declared in the dtd or schema.
Error: URI=file:d:/bea61sp1/registry.xml Line=8: Element type "component" is not
declared in the dtd or schema.
BEA WebLogic 6.1 license found...
It seems that the XML validation of the license file falls in error because I
don't use the right XML parser.
Could you tell me which is the right XML parser to use when I launch the jCOM
bridge launches ?
Besides, is it possible to give a parser class to the bridge class with properties,
like with JAXP via option -D.... in the line command ?
Thanks.
RichardThere are two oracle_xmlparserv2.jar in your classpath? Would you make sure the correct version is used?
-
XSD Validation with ABAP XML Parser?
Hello there,
i'm loading xml files into a R/3 System. This all works fine with the standard XML Parser.
The XML Files are based on a .xsd structure that is assigned to each file with a external link.
To be sure that the xml document conforms to this .xsd structure i would like to check against it.
For that i would like to hold a .xsd structure string in my abap programm.
How can this be accomplished? Is this possible anyway?
Greetings and many thanks.
Kaycheck out the class
CL_XML_SCHEMA
Regards
Raja -
XML validation using Oracle XML parser v2
Not sure if this is the right forum for this question as I didn't found any.
I had a tough time trying to build an XMLSchema (Oracle XML Parser V2) object from the input schema having include/import. Actually I am working on a Java program to validate the input xml with input schema using Oracle XML parser v2 api.
The issue is that the code doesn't work for schema that has some "include" in it. The code is working fine for the schema without any import/include. Here is the lines of code -
XSDBuilder builder = new XSDBuilder();
schema = builder.build(new InputSource(xsdReader));
I am writing this in JDeveloper. The error is -
oracle.xml.parser.schema.XSDException: Can not build schema 'http://www.fpml.org/2005/FpML-4-2' located at 'xsd\FpML42\xml\fpml-fx-4-2.xsd'
I also tried creating the EntityResolver to specify the path of included schema. But that doesn't solves the problem.
I am not sure whether parser is able to locate the included schema or not.The main schema and included schema are all in same folder. The included schema is perfectly fine and has no errors.
Please help if you have encountered this issue and resolved it. I will really appreciate any pointers or clue to solve this issue.
Thanks.Thanks for the reply. But it does not seem to be working. Am I missing something
I put <TrxDate xsi:nil="true"/> but still getting error.
Here's my xsd:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:element name="TrxDate" type="xsd:date" nillable="true" />
XML:
<?xml version="1.0" encoding="UTF-8" ?>
<ServiceRequest>
<TrxDate nil="true"/>
</ServiceRequest> -
Oracle XML Parser validation against XML Sxhema
Hi,
I am developing a program in C++ on Unix, that does parsing on an XML document. For parsing I am using "Oracle XML Parser" [using DOM API]. My question is, Can Oracle XML Parser validate xml document against an XML Schema file also? I have read in many tutorials that it can validate against DTD. Please clarify my question as early as possible?
Regards,
Raghuram.Hi Kulkarni,
I think you are trying to retrieve the text of the parent element of book. For example if this is the xml element
<bookdetails>
<book>Harry Potter</book>
<author>JK Rowling</author>
<price>34.55</price>
</book>
</bookdetails>
You must be trying to retrieving the text of bookdetails.
Check XMLNode.getNodeName() to retrieve the name of the node.
To get 'Harry Potter' as output you need to traverse till book and then use XMLNode.getText()
You can check the 'getQuestions()' method in Survey Sample
to know how to tranverse to any element of an XML using Java.
The Survey Sample is located at
http://otn.oracle.com/sample_code/tech/xml/survey/content.html
Download the sample and unjar it. The location of Analyser.java is
SurveySample\code\Survey\src\oracle\otnsamples\survey\business\Analyser.java
Have a look at it.
Regards,
Anupama
http://otn.oracle.com/sample_code/content.html -
Change categories validator says XML parsing error: unknown :unbound prefix
I want to change the categories in my feed
http://www.iAudioguide.com/podcast.xml
and the feedvalidator.org says
http://feedvalidator.org/check.cgi?url=www.iAudioguide.com%2Fpodcast.xml
XML parsing error: <unknown>:16:0: unbound prefix
whereas I thought thats just what I had to add for the itunes categories
<itunes:category text="Society & Culture">
<itunes:category text="Travel & Places" />
</itunes:category>It's because you're not telling the world that you'll be calling up the iTunes podcasting dtd. Make sure your 2nd line looks like this:
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
...and that way anything that looks at your feed will be able to reference the iTunes tags correctly.
-S -
am using XML parser for PL/SQL in Oracle9i Enterprise Edition Release 9.0.1.1.1
When i run the sample xml program, i get error which is as follows. While compiling no errors. But while executing it reports error as given below.
SQL> execute domsample('c:\xml', 'family.xml', 'errors.txt');
begin domsample('c:\xml', 'family.xml', 'errors.txt'); end;
ORA-20100: Error occurred while parsing: No such file or directory
ORA-06512: at "COMMODITYBACKCONNECT.XMLPARSER", line 22
ORA-06512: at "COMMODITYBACKCONNECT.XMLPARSER", line 79
ORA-06512: at "COMMODITYBACKCONNECT.DOMSAMPLE", line 80
ORA-06512: at line 1
What need to be done to rectify the above problem.
when i do the following validation check
SQL>
SQL> select substr(dbms_java.longname(object_name),1,30) as class, status
2 from all_objects
3 where object_type = 'JAVA CLASS'
4 and object_name = dbms_java.shortname('oracle/xml/parser/v2/DOMParser')
5 ;
CLASS STATUS
oracle/xml/parser/v2/DOMParser VALID
oracle/xml/parser/v2/DOMParser VALID
Please advice to how remove the following error:
ORA-20100: Error occurred while parsing: No such file or directoryFound the solution on metalink. There is a file under /$ORACLE_HOME/javavm/install/init_security.sql
which needs to be run under username where you are installing xml parser.
This step is not in readme.txt file provided as a part of download from the OTN website. -
Xml parsing error while selecting whole result set for sql query
Hi All,
I am having xml parsing error while selecting whole query result set. The data is coming fine for default result set of 50 rows.
My exception is below.
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00234: namespace prefix "xsi" is not declared
Error at line 1
ORA-06512: at "SYS.XMLTYPE", line 254
ORA-06512: at line 1
*31011. 00000 - "XML parsing failed"*
**Cause: XML parser returned an error while trying to parse the document.*
**Action: Check if the document to be parsed is valid.*
My sql query is below that is giving results for default result set of 50 rows.
select extract(xmlType(clob_xml_colm_name), '//v2:node1//childnode/text()','xmlns:v2="namespace_url"').getStringVal() from table_name
My sql developer version is below.
Java(TM) Platform 1.7.0_04
Oracle IDE 3.1.07.42
Versioning Support 3.1.07.42
My database version is below.
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit
Please could any one help me urgently as the sql query is supposed to be correct as it is returning query results, but the problem happening when i try to select whole result set.
Thanks and regards,What does the XML look like? It appears that some of the supposed XML stored as a CLOB is not really valid XML. Find the row in the table that is causing your issue and review the "XML" in it.
-
Why the oracle XML parser "parses" the DTD comments?
Hi all,
I always use the header
<?xml version = '1.0' encoding='ISO-8859-1' ?>
to be able to use foreign characters in the XML documents.
The oracle xml parser handles this correctly.
My problem is, when I write comments inside the DTD, the
parser reports "Invalid UTF8 encoding".
Why the parser "parse" the comments? (protected by <!-- and -->)
How do I say that the DTD encoding is different from UTF, like
ISO-8859-1?
Example of a correct DTD and corresponding XML, reporting
problems, related to the 2nd comment in the DTD specification,
written with ISO-8859-1 characters.
The DTD:
<!-- valid.dtd -->
<!ELEMENT valid ( B, C ) >
<!-- valid represents the concept "Identificagco" -->
<!ELEMENT B (#PCDATA) >
<!ELEMENT C (#PCDATA) >
The XML:
<?xml version = '1.0' encoding='ISO-8859-1' ?>
<!DOCTYPE valid SYSTEM 'valid.dtd'>
<valid>
<B>How are you, Conceigco</B>
<C>I'm fine, thank you.</C>
</valid>
The parser output:
[jgr@frontera test-dtd]$ java oracle.xml.parser.v2.oraxml -v
valid.xml
Error while parsing input sourcevalid.xml(Invalid UTF8 encoding.)
Thank you for any help.
Jorge Gustavo RochaI was wrong in saying that the attributes are not added to the element.My main aim is to add a array of elements to the root node.
Is there a efficient manner in adding the elements , rather than adding them individually with the help of appendChild method.
Thanks in advance.
null -
Hi,
while trying to get a soapelement from xml file, i have the error : oracle.xml.parser.v2.XMLParseException: Start of root element expected
the code i m using is as follow :
public static SOAPMessage XMLDocToSOAP(String soapBodyAsString ) throws SAXException, IOException,
SOAPException,
ParserConfigurationException {
SOAPMessage message = null;
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
InputStream is = new ByteArrayInputStream(soapBodyAsString.getBytes());
Document doc = dbf.newDocumentBuilder().parse(is);
MessageFactory factory = MessageFactory.newInstance();
message = factory.createMessage();
message.saveChanges();
SOAPBodyElement element = message.getSOAPBody().addDocument(doc);
return message;
}Looks like the XML you are passing is not valid. Check that the XML complies the the definition.
Also can you post a XML that works and the one that fails.
cheers
James
Maybe you are looking for
-
Shut down problem on new macbook pro 13"
Hey, Just a new convert to mac after ditching my glitchy windows desktop replacement. Been really enjoying the mac (i've had it for 3 days now). I've experienced a shut down problem where everything would close, like the dock and the bar up the top.
-
Java.lang.OutOfMemoryError: allocLargeObjectOrArray error for large payload
Our is an outbound flow where one FTP adapter picks the files and it calls a requester service, requester service calls the EBS and EBS calls the provider service, and finally file is getting written using the B2B. Since last 4/5 days we are getting
-
Has there been any indication that a Service Pack 3 will be released?
There have been a number of cumulative updates. In the past, there was some caution expressed regarding not applying CUs unless there was a specific issue that the CU addressed. It has been a year since the last Service Pack. The CUs have included qu
-
Fatal error message-acrobat failed
I cannot download anything. I keep getting acrobat failed to load its core dll. What does this mean and how can I correct this?
-
Spry.Effect.Slide - cannot set initial state.
I have 3 div elements using the Spry.Effect.Slide effect. I use CSS to close 2 elements and leave 1 element open. It works fine in Firefox. But in IE7 when the hidden elements slide down to show, its still display of none!! In firefox, the elements a