הצטרפו לקבוצות שלנו לקבלת עדכונים מרוכזים פעם בשבוע:

ווטסאפ:
http://wa.dwh.co.il
טלגרם:
http://telegram.dwh.co.il

איך ניתן לבצע וולידציית XML כנגד XSD

More
15 years 10 months ago #5121 by Or Pelach
שלום,
מצ"ב קובץ אשר מסביר כיצד ניתן לבצע וולידציית XML כנגד XSD
בברכה,
אור

Please התחברות to join the conversation.

More
14 years 2 months ago #7106 by eliazu
היי אור
היכן המסמך ?

בדיוק נתקלתי בבעייה כזו,

תודה רבה
אלירן

Please התחברות to join the conversation.

More
14 years 2 months ago #7114 by Or Pelach

HOW TO: Validate XML sources against XSD

Solution

When reading XML file, a session can be configured to validate XML sources. The validation in PowerCenter is based on XSD/DTD validation.

In order to enable XML validation, the following conditions have to be true:
•The session property Validate XML Source on the XML source should be set to Validate only if DTD/Schema is present or Always validate.
•The source XML file should have a reference to the XSD file. This can be done by providing the schemaLocation attribute in the root element of the XML document.

Example

<note
xmlns=" www.w3schools.com "
xmlns:xsi=" www.w3.org/2001/XMLSchema-instance "
xsi:schemaLocation=" www.w3schools.com source.xsd">

This will refer to the source.xsd file which can be found in the same directory as the XML source.

More Information

Validate only if DTD/Schema is present will only validate the source XML if the reference to the XSD schema is present in the XML file.

Always validate will try to validate the source XML even without the reference to the schema.

When validation is performed on a XML file without the schema reference, you will encounter session errors indicating that the root element of the provided XML source is not defined:


XML Reader: Error [ElementNotDefined] occurred while parsing:[Error at (file e:\source.xml, line 6, char 2 ): Unknown element 'root'.];

Please התחברות to join the conversation.

More
14 years 2 months ago #7115 by eliazu

Please התחברות to join the conversation.

Moderators: Laromme Barr
Time to create page: 0.226 seconds