ComposantsComponents › XML
Valide du XML par rapport à un schéma XSD, avec le validateur du JDK (javax.xml.validation). En Mode fichier, il valide un fichier et produit une ligne qui décrit le résultat ; les erreurs trouvées vont dans la console et dans une variable globale. En Mode flux, il valide, ligne par ligne, le texte XML de colonnes d'un flux entrant : les lignes valides partent par Main, les autres par Rejects, avec le message d'erreur. Pour un schéma DTD, prenez un tDTDValidator.
Validates XML against an XSD schema, with the JDK validator (javax.xml.validation). In File Mode, it validates a file and produces one row that describes the result; the errors found go to the console and to a global variable. In Flow Mode, it validates, row by row, the XML text of columns of an incoming flow: the valid rows leave through Main, the others through Rejects, with the error message. For a DTD schema, take a tDTDValidator.
EntréeInput
Mode fichier : aucune, il commence son sous-job (ou un lien Iterate). Mode flux : un lien Main. File Mode: none, it starts its subjob (or one Iterate link). Flow Mode: one Main link.
SortieOutput
Main mode fichier : une ligne, le résultat ; mode flux : les lignes valides.File Mode: one row, the result; Flow Mode: the valid rows.
Rejects mode flux seulement : les lignes invalides, avec errorMessage.Flow Mode only: the invalid rows, with errorMessage.
Déclencheurs en sortieOutput triggers
On Subjob Ok On Subjob Error On Component Ok On Component Error Run if
Mode fichier. La condition du lien Run if lit le résultat : ((Boolean) globalMap.get("tXSDValidator_1_VALID")). Le tFileInputXML ne lit le fichier que s'il est valide.
File Mode. The condition of the Run if link reads the result: ((Boolean) globalMap.get("tXSDValidator_1_VALID")). The tFileInputXML reads the file only if it is valid.
Mode flux. Chaque ligne entrante a une colonne de texte XML ; la table Allouer dit quel XSD la valide. Les lignes invalides partent par Rejects. Flow Mode. Each incoming row has a column of XML text; the Allocate table says which XSD validates it. The invalid rows leave through Rejects.
Le schéma du composant dépend du Mode : quand on change de mode, il est remplacé par celui du nouveau mode, comme dans le Studio. Ce que reçoit le flux de sortie dans chaque mode : The component schema depends on the Mode: when the mode changes, it is replaced by the one of the new mode, as in the Studio. What the output flow gets in each mode:
Schéma fixe, en lecture seule. Une seule ligne sort, après la validation : Fixed, read-only schema. A single row leaves, after the validation:
toString())the Xml file as text (toString())tXSDValidator_1)name of the component (tXSDValidator_1)1 valide, 0 invalide1 valid, 0 invalid
Le schéma devient vide au passage en mode flux. Le composant ne reçoit pas celui de son entrée quand on relie le flux (en-tête SCHEMA_AUTO_PROPAGATE="false", comme dans le Studio) : copiez-le vous-même, par Modifier le schéma et le bouton ». Chaque colonne du schéma reçoit la colonne de même nom de l'entrée ; Rejects a les mêmes colonnes, plus errorMessage.
The schema becomes empty when switching to flow mode. The component does not get the one of its input when the flow is connected (SCHEMA_AUTO_PROPAGATE="false" header, as in the Studio): copy it yourself, with Edit schema and the » button. Each schema column gets the input column with the same name; Rejects has the same columns, plus errorMessage.
Schéma laissé vide : rien n'est validé, et chaque ligne sort par Main sans aucune colonne (exemple). Schema left empty: nothing is validated, and each row leaves through Main without any column (example).
Talaxie 9.0.6 ou antérieur ne vide pas le schéma au passage en mode flux : il garde les sept colonnes du mode fichier. Remplacez-les toutes par celles de l'entrée (bouton », qui copie tout le schéma) ; sinon le code généré cherche xsdfile… dans le flux entrant. Corrigé à partir de Talaxie 9.0.7, qui vide le schéma comme le Studio.
Talaxie 9.0.6 or earlier does not empty the schema when switching to flow mode: it keeps the seven columns of the file mode. Replace them all with those of the input (» button, which copies the whole schema); otherwise the generated code looks for xsdfile… in the incoming flow. Fixed from Talaxie 9.0.7, which empties the schema as the Studio does.
Les libellés sont ceux de l'onglet Composant ; le nom technique, en gris, est celui du paramètre dans le fichier du job. Chemins et messages sont des expressions Java. Labels are those of the Component tab; the technical name, in grey, is the parameter name in the job file. Paths and messages are Java expressions.
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| ModeMODE | Mode fichierFile Mode | ToujoursAlways | Mode fichier : un fichier XML. Mode flux : des colonnes du flux entrant. Le schéma suit le mode (voir les deux modes). File Mode: an XML file. Flow Mode: columns of the incoming flow. The schema follows the mode (see the two modes). |
| SchémaSchemaSCHEMA | selon le modedepends on the mode | ToujoursAlways |
Mode fichier : sept colonnes fixes. Mode flux : les colonnes de l'entrée, à copier. Le schéma de Rejects (SCHEMA_REJECT) le reprend, plus errorMessage.
File Mode: seven fixed columns. Flow Mode: the input columns, to be copied. The Rejects schema (SCHEMA_REJECT) takes it, plus errorMessage.
|
| AllouerAllocateMANUALTABLE | videempty | Mode fluxFlow Mode | Une ligne par colonne à valider : Colonne d'entrée (une colonne du flux, de type String) et Fichier XSD (chemin, expression Java). Les colonnes absentes de la table passent sans contrôle. D'après le modèle, une colonne listée deux fois garde le dernier XSD. One row per column to validate: Input Column (a flow column, of type String) and XSD File (path, Java expression). The columns missing from the table go through unchecked. Per the template, a column listed twice keeps the last XSD. |
| Fichier XSDXsd fileXSDFILE | chemin par défaut + /need_test.xsddefault path + /need_test.xsd |
Mode fichierFile Mode |
Le schéma XSD. D'après le modèle, une valeur qui commence par http et finit par xsd est chargée comme une adresse web (non essayé). Un XSD introuvable n'arrête pas le job : le fichier est déclaré invalide (voir les erreurs).
The XSD schema. Per the template, a value that starts with http and ends with xsd is loaded as a web address (not tried). An XSD that cannot be found does not stop the job: the file is reported invalid (see the errors).
|
| Fichier XMLXml fileXMLFILE | chemin par défaut + /reference.xmldefault path + /reference.xml |
Mode fichierFile Mode |
Le fichier validé, ou un java.io.InputStream : new java.io.FileInputStream("C:/data/order-ok.xml") a donné le même résultat, et la colonne xmlfile a reçu java.io.FileInputStream@2d3fcdbd. D'après le modèle, un flux ainsi passé n'est pas fermé.
The validated file, or a java.io.InputStream: new java.io.FileInputStream("C:/data/order-ok.xml") gave the same result, and the xmlfile column got java.io.FileInputStream@2d3fcdbd. Per the template, a stream given this way is not closed.
|
| Afficher si le XML est valideIf XML is valid, displayVALID_MESSAGE | "[job " + jobName + "] File is Valid" |
Mode fichierFile Mode |
Le message d'un fichier valide : colonne message, console, et variable ERROR_MESSAGE.
The message of a valid file: message column, console, and ERROR_MESSAGE variable.
|
| Afficher si XML invalideIf XML is invalid, displayINVALID_MESSAGE | "[job " + jobName + "] File is Invalid" |
Mode fichierFile Mode | Le message d'un fichier invalide, de même. The message of an invalid file, likewise. |
| Afficher dans la consolePrint to consolePRINT | OuiYes | Mode fichierFile Mode |
Écrit le message sur la sortie standard et, pour un fichier invalide, le détail des erreurs sur la sortie d'erreur. Décochée : rien n'est écrit, les erreurs restent dans XSD_ERROR_MESSAGE.
Writes the message to the standard output and, for an invalid file, the details of the errors to the error output. Unchecked: nothing is written, the errors stay in XSD_ERROR_MESSAGE.
|
| ParamètreSetting | DéfautDefault | VisibleShown | Description |
|---|---|---|---|
| Activer les fonctionnalitésEnable FeaturesENABLE_FEATURES | videempty | ToujoursAlways |
Colonne Fonctionnalité : un nom de fonctionnalité (expression Java), activé sur la fabrique de schémas du JDK (SchemaFactory.setFeature(…, true)). javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING a été accepté ; un nom inconnu arrête le composant (voir les erreurs).
Feature column: a feature name (Java expression), enabled on the schema factory of the JDK (SchemaFactory.setFeature(…, true)). javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING was accepted; an unknown name stops the component (see the errors).
|
| EncodageEncodingENCODING | "UTF-8" |
ToujoursAlways | D'après le modèle, seulement en mode flux : l'encodage dans lequel le texte de la colonne est converti en octets avant d'être lu. En mode fichier, il ne sert pas : l'analyseur suit la déclaration du fichier. Per the template, in flow mode only: the encoding in which the column text is converted to bytes before being read. In file mode, it is not used: the parser follows the declaration of the file. |
Écrites à chaque validation : en mode flux, à chaque ligne, et c'est la dernière ligne qu'on lit après le sous-job. Valeurs relevées par un tJava dans les exemples. Written at each validation: in flow mode, at each row, and the last row is the one read after the subjob. Values read by a tJava in the examples.
"1" valide, "0" invalide.String, Difference: "1" valid, "0" invalid.true pour une ligne rejetée (voir les erreurs).Boolean, True if xml file is valid. In flow mode, it can be true for a rejected row (see the errors)."null" pour un fichier valide. Mode flux : chaque colonne invalide précédée de son nom (xml: …), vide pour une ligne valide.String, XSD Error Message: the errors, one per line. File Mode: the "null" text for a valid file. Flow Mode: each invalid column preceded by its name (xml: …), empty for a valid row.null s'il n'y en a pas eu. Après une exception, son message.String. File Mode: the displayed message, valid or invalid, and not an error. Flow Mode: the message of the last reading error (a malformed XML in our runs), kept for the following rows; null if there was none. After an exception, its message.((String) globalMap.get("tXSDValidator_1_DIFFERENCE"))
((Boolean) globalMap.get("tXSDValidator_1_VALID"))
((String) globalMap.get("tXSDValidator_1_XSD_ERROR_MESSAGE"))
((String) globalMap.get("tXSDValidator_1_ERROR_MESSAGE"))
Les jobs ont été exécutés dans Talaxie, avec Java 21 ; les sorties sont celles de la console, copiées telles quelles. Le dossier des fichiers est remplacé par C:/data et le nom du job par MyJob. Les messages de validation viennent du JDK, dans la langue du système (ici le français). Après le sous-job, un tJava relié par On Subjob Ok affiche les quatre variables globales. En mode fichier, la sortie Main va vers un tLogRow en mode simple (séparateur |).
The jobs were run in Talaxie, with Java 21; the outputs are the console ones, copied as they are. The files folder is replaced with C:/data and the job name with MyJob. The validation messages come from the JDK, in the system language (French here). After the subjob, a tJava connected with On Subjob Ok prints the four global variables. In file mode, the Main output goes to a tLogRow in basic mode (| separator).
Schéma order.xsd :order.xsd schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="order">
<xs:complexType>
<xs:sequence>
<xs:element name="customer" type="xs:string"/>
<xs:element name="line" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="product" type="xs:string"/>
<xs:element name="quantity" type="xs:positiveInteger"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
Fichier order-ok.xml :order-ok.xml file:
<?xml version="1.0" encoding="UTF-8"?> <order id="A-100"> <customer>Ada Lovelace</customer> <line><product>Pen</product><quantity>3</quantity></line> <line><product>Ink</product><quantity>1</quantity></line> </order>
Fichier order-bad.xml : sans id, une quantité two, un élément qty :order-bad.xml file: no id, a two quantity, a qty element:
<?xml version="1.0" encoding="UTF-8"?> <order> <customer>Grace Hopper</customer> <line><product>Pen</product><quantity>two</quantity></line> <line><product>Ink</product><qty>1</qty></line> </order>
Fichier XSD "C:/data/order.xsd", Fichier XML "C:/data/order-ok.xml", autres réglages par défaut :Xsd file "C:/data/order.xsd", Xml file "C:/data/order-ok.xml", other settings by default:
[job MyJob] File is Valid C:/data/order.xsd|C:/data/order-ok.xml|2026-11-20 20:12:27|MyJob|tXSDValidator_1|1|[job MyJob] File is Valid DIFFERENCE = 1 VALID = true XSD_ERROR_MESSAGE = null ERROR_MESSAGE = [job MyJob] File is Valid
Même job avec "C:/data/order-bad.xml" :Same job with "C:/data/order-bad.xml":
[job MyJob] File is Invalid
There is an Error on line 2 : cvc-complex-type.4 : L'attribut 'id' doit figurer dans l'élément 'order'.
There is an Error on line 4 : cvc-datatype-valid.1.2.1 : 'two' n'est pas une valeur valide pour 'integer'.
There is an Error on line 4 : cvc-type.3.1.3 : La valeur 'two' de l'élément 'quantity' n'est pas valide.
There is an Error on line 5 : cvc-complex-type.2.4.a : Contenu non valide trouvé à partir de l'élément 'qty'. L'une des valeurs '{quantity}' est attendue.
C:/data/order.xsd|C:/data/order-bad.xml|2026-11-20 20:12:30|MyJob|tXSDValidator_1|0|[job MyJob] File is Invalid
DIFFERENCE = 0
VALID = false
XSD_ERROR_MESSAGE = There is an Error on line 2 : cvc-complex-type.4 : L'attribut 'id' doit figurer dans l'élément 'order'.
There is an Error on line 4 : cvc-datatype-valid.1.2.1 : 'two' n'est pas une valeur valide pour 'integer'.
There is an Error on line 4 : cvc-type.3.1.3 : La valeur 'two' de l'élément 'quantity' n'est pas valide.
There is an Error on line 5 : cvc-complex-type.2.4.a : Contenu non valide trouvé à partir de l'élément 'qty'. L'une des valeurs '{quantity}' est attendue.
ERROR_MESSAGE = [job MyJob] File is Invalid
There is an Error… vont sur la sortie d'erreur, le message sur la sortie standard. Le job se termine normalement (code 0).
The validator goes on after an error: the four are listed, with their line. The There is an Error… lines go to the error output, the message to the standard output. The job ends normally (exit code 0).
XSD_ERROR_MESSAGE reprend les erreurs ; il vaut le texte null pour le fichier valide. ERROR_MESSAGE reçoit le message affiché, même pour un fichier valide.
XSD_ERROR_MESSAGE holds the errors; it is the null text for the valid file. ERROR_MESSAGE gets the displayed message, even for a valid file.
"KO: order rejected" pour un XML invalide : la console n'a plus que la ligne du tLogRow (qui finit par |0|KO: order rejected) et les variables, identiques sauf ERROR_MESSAGE = KO: order rejected.
Print to console unchecked, message "KO: order rejected" for an invalid XML: the console only has the tLogRow line (ending with |0|KO: order rejected) and the variables, the same except ERROR_MESSAGE = KO: order rejected.
Le tFixedFlowInput donne quatre lignes, colonnes String id et xml : F-1 valide, F-2 de quantité 0 (le XSD veut un entier positif), F-3 mal formé (<order id="F-3"><customer>Alan</customer>, sans fin), F-4 valide. Schéma du tXSDValidator copié de l'entrée ; table Allouer : colonne xml, fichier "C:/data/order.xsd". Les deux tLogRow sont en mode simple et affichent leur nom :
The tFixedFlowInput gives four rows, String columns id and xml: F-1 valid, F-2 with a 0 quantity (the XSD wants a positive integer), F-3 malformed (<order id="F-3"><customer>Alan</customer>, without an end), F-4 valid. Schema of the tXSDValidator copied from the input; Allocate table: xml column, file "C:/data/order.xsd". Both tLogRow components are in basic mode and print their name:
[tLogRow_1] F-1|<order id="F-1"><customer>Ada</customer><line><product>Pen</product><quantity>3</quantity></line></order> [tLogRow_2] F-2|<order id="F-2"><customer>Grace</customer><line><product>Ink</product><quantity>0</quantity></line></order>|xml: There is an Error on line 1 : cvc-minInclusive-valid : La valeur '0' n'est pas un facet valide par rapport à minInclusive '1' pour le type 'positiveInteger'. There is an Error on line 1 : cvc-type.3.1.3 : La valeur '0' de l'élément 'quantity' n'est pas valide. [tLogRow_2] F-3|<order id="F-3"><customer>Alan</customer>|xml: There is a Fatal Error on line 1 : Les structures de document XML doivent commencer et se terminer dans la même entité. There is an Error on line 1 : Les structures de document XML doivent commencer et se terminer dans la même entité. [tLogRow_1] F-4|<order id="F-4"><customer>Edsger</customer><line><product>Pad</product><quantity>5</quantity></line></order> DIFFERENCE = 1 VALID = true XSD_ERROR_MESSAGE = ERROR_MESSAGE = Les structures de document XML doivent commencer et se terminer dans la même entité.
errorMessage commence par le nom de la colonne ; ses erreurs sont séparées par des sauts de ligne. Un XML mal formé donne une erreur fatale, puis la même erreur une seconde fois.
errorMessage starts with the column name; its errors are separated by line breaks. A malformed XML gives a fatal error, then the same error a second time.
ERROR_MESSAGE, resté sur l'erreur fatale de F-3.
The variables are those of the last row (F-4, valid), except ERROR_MESSAGE, left on the fatal error of F-3.
Même job sans lien Rejects : les lignes invalides sont écartées, et leurs erreurs vont sur la sortie d'erreur :Same job without a Rejects link: the invalid rows are dropped, and their errors go to the error output:
[tLogRow_1] F-1|<order id="F-1"><customer>Ada</customer><line><product>Pen</product><quantity>3</quantity></line></order> xml: There is an Error on line 1 : cvc-minInclusive-valid : La valeur '0' n'est pas un facet valide par rapport à minInclusive '1' pour le type 'positiveInteger'. There is an Error on line 1 : cvc-type.3.1.3 : La valeur '0' de l'élément 'quantity' n'est pas valide. xml: There is a Fatal Error on line 1 : Les structures de document XML doivent commencer et se terminer dans la même entité. There is an Error on line 1 : Les structures de document XML doivent commencer et se terminer dans la même entité. [tLogRow_1] F-4|<order id="F-4"><customer>Edsger</customer><line><product>Pad</product><quantity>5</quantity></line></order> …
Le même job, sans copier le schéma de l'entrée dans le tXSDValidator (mode choisi puis flux relié, ou l'inverse : même résultat). Ni le tXSDValidator ni le tLogRow n'ont de colonnes : The same job, without copying the input schema into the tXSDValidator (mode chosen then flow connected, or the reverse: same result). Neither the tXSDValidator nor the tLogRow has columns:
[tLogRow_1] [tLogRow_1] [tLogRow_1] [tLogRow_1] DIFFERENCE = 0 VALID = false XSD_ERROR_MESSAGE = ERROR_MESSAGE = null
Les quatre lignes sortent vides par Main, sans erreur ni avertissement : aucune colonne n'a été validée, même F-3, mal formée. The four rows leave empty through Main, without error or warning: no column was validated, not even the malformed F-3.
Mêmes jobs que dans les exemples. Les piles d'appels sont abrégées (…). Quand le job a un tJava relié par On Subjob Error, il affiche [On Subjob Error] puis les variables.
Same jobs as in the examples. The stack traces are shortened (…). When the job has a tJava connected with On Subjob Error, it prints [On Subjob Error] then the variables.
Mode fichier, order-broken.xml, où <quantity>2</line> n'est pas fermé :File Mode, order-broken.xml, where <quantity>2</line> is not closed:
[job MyJob] File is Invalid There is a Fatal Error on line 4 : Le type d'élément "quantity" doit se terminer par la balise de fin correspondante "</quantity>". There is an Error on line 4 : Le type d'élément "quantity" doit se terminer par la balise de fin correspondante "</quantity>". C:/data/order.xsd|C:/data/order-broken.xml|2026-11-20 20:12:32|MyJob|tXSDValidator_1|0|[job MyJob] File is Invalid DIFFERENCE = 0 VALID = false XSD_ERROR_MESSAGE = There is a Fatal Error on line 4 : Le type d'élément "quantity" doit se terminer par la balise de fin correspondante "</quantity>". There is an Error on line 4 : Le type d'élément "quantity" doit se terminer par la balise de fin correspondante "</quantity>". ERROR_MESSAGE = [job MyJob] File is Invalid
Un fichier mal formé est un fichier invalide : le job continue. L'erreur est écrite deux fois, comme « Fatal Error » puis comme « Error ».A malformed file is an invalid file: the job goes on. The error is written twice, as “Fatal Error” then as “Error”.
Fichier XML "C:/data/missing.xml", absent :Xml file "C:/data/missing.xml", missing:
[job MyJob] File is Invalid There is an Error on line : C:\data\missing.xml (Le fichier spécifié est introuvable) … DIFFERENCE = 0 VALID = false …
Fichier XSD "C:/data/missing.xsd", absent, avec le fichier valide :Xsd file "C:/data/missing.xsd", missing, with the valid file:
[job MyJob] File is Invalid There is an Error on line -1 : schema_reference.4 : Echec de la lecture du document de schéma 'file:/C:/data/missing.xsd' pour les raisons suivantes : 1) Le document est introuvable ; 2) Le document n'a pas pu être lu ; 3) L'élément racine du document n'est pas <xsd:schema>. … DIFFERENCE = 0 VALID = false …
Dans les deux cas, le job continue et le fichier est déclaré invalide. Un fichier qui n'est pas un XSD (le fichier XML lui-même) donne de même s4s-elt-character et VALID = false. Testez XSD_ERROR_MESSAGE pour distinguer un schéma inutilisable d'un fichier invalide.In both cases, the job goes on and the file is reported invalid. A file that is not an XSD (the XML file itself) likewise gives s4s-elt-character and VALID = false. Test XSD_ERROR_MESSAGE to tell an unusable schema from an invalid file.
Activer les fonctionnalités : "http://example.org/no-such-feature" :Enable Features: "http://example.org/no-such-feature":
Exception in component tXSDValidator_1 (MyJob) org.xml.sax.SAXNotRecognizedException: La fonctionnalité 'http://example.org/no-such-feature' n'est pas reconnue. at java.xml/com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.setFeature(XMLSchemaFactory.java:489) at demo.myjob_0_1.MyJob.tXSDValidator_1Process(MyJob.java:1123) … [On Subjob Error] DIFFERENCE = null VALID = null XSD_ERROR_MESSAGE = null ERROR_MESSAGE = La fonctionnalité 'http://example.org/no-such-feature' n'est pas reconnue.
Deux lignes, F-1 valide puis F-2 invalide. Colonnes id puis xml :Two rows, F-1 valid then F-2 invalid. Columns id then xml:
[tLogRow_1] F-1|<order id="F-1"><customer>Ada</customer><line><product>Pen</product><quantity>3</quantity></line></order> [tLogRow_2] F-2|<order id="F-2"><customer>Grace</customer><line><product>Ink</product><quantity>0</quantity></line></order>|xml: There is an Error on line 1 : cvc-minInclusive-valid : La valeur '0' n'est pas un facet valide par rapport à minInclusive '1' pour le type 'positiveInteger'. There is an Error on line 1 : cvc-type.3.1.3 : La valeur '0' de l'élément 'quantity' n'est pas valide. DIFFERENCE = 1 VALID = true XSD_ERROR_MESSAGE = xml: There is an Error on line 1 : cvc-minInclusive-valid : La valeur '0' n'est pas un facet valide par rapport à minInclusive '1' pour le type 'positiveInteger'. There is an Error on line 1 : cvc-type.3.1.3 : La valeur '0' de l'élément 'quantity' n'est pas valide. ERROR_MESSAGE = null
Mêmes lignes, colonnes xml puis id :Same rows, columns xml then id:
[tLogRow_1] <order id="F-1"><customer>Ada</customer><line><product>Pen</product><quantity>3</quantity></line></order>|F-1 [tLogRow_2] <order id="F-2"><customer>Grace</customer><line><product>Ink</product><quantity>0</quantity></line></order>|F-2|xml: There is an Error on line 1 : cvc-minInclusive-valid : La valeur '0' n'est pas un facet valide par rapport à minInclusive '1' pour le type 'positiveInteger'. There is an Error on line 1 : cvc-type.3.1.3 : La valeur '0' de l'élément 'quantity' n'est pas valide. DIFFERENCE = 0 VALID = false XSD_ERROR_MESSAGE = xml: There is an Error on line 1 : cvc-minInclusive-valid : La valeur '0' n'est pas un facet valide par rapport à minInclusive '1' pour le type 'positiveInteger'. There is an Error on line 1 : cvc-type.3.1.3 : La valeur '0' de l'élément 'quantity' n'est pas valide. ERROR_MESSAGE = null
Défaut du modèle de Talaxie (tXSDValidator_main.javajet, lignes 193-196 et 224-226) : une colonne passée sans erreur jusque-là, même non validée, met VALID à true, et rien ne le remet à false. Avec une colonne non validée avant la colonne XML, la ligne F-2, rejetée, donne VALID = true. Fiez-vous au lien Rejects plutôt qu'à VALID en mode flux.Defect of the Talaxie template (tXSDValidator_main.javajet, lines 193-196 and 224-226): a column passed without error so far, even unvalidated, sets VALID to true, and nothing sets it back to false. With an unvalidated column before the XML column, row F-2, rejected, gives VALID = true. Rely on the Rejects link rather than on VALID in flow mode.
Colonnes id, first, second, les deux dernières dans Allouer. T-1 : first valide, second de quantité 0 ; T-2 : l'inverse :Columns id, first, second, the last two in Allocate. T-1: first valid, second with a 0 quantity; T-2: the reverse:
[tLogRow_2] T-1|<order id="A"><customer>Ada</customer><line><product>Pen</product><quantity>3</quantity></line></order>|<order id="B"><customer>Ada</customer><line><product>Ink</product><quantity>0</quantity></line></order>|second: There is an Error on line 1 : cvc-minInclusive-valid : La valeur '0' n'est pas un facet valide par rapport à minInclusive '1' pour le type 'positiveInteger'. There is an Error on line 1 : cvc-type.3.1.3 : La valeur '0' de l'élément 'quantity' n'est pas valide. [tLogRow_2] T-2|<order id="C"><customer>Grace</customer><line><product>Pen</product><quantity>0</quantity></line></order>|<order id="D"><customer>Grace</customer><line><product>Ink</product><quantity>1</quantity></line></order>|second: There is an Error on line 1 : cvc-minInclusive-valid : La valeur '0' n'est pas un facet valide par rapport à minInclusive '1' pour le type 'positiveInteger'. There is an Error on line 1 : cvc-type.3.1.3 : La valeur '0' de l'élément 'quantity' n'est pas valide. DIFFERENCE = 1 VALID = true XSD_ERROR_MESSAGE = first: There is an Error on line 1 : cvc-minInclusive-valid : La valeur '0' n'est pas un facet valide par rapport à minInclusive '1' pour le type 'positiveInteger'. There is an Error on line 1 : cvc-type.3.1.3 : La valeur '0' de l'élément 'quantity' n'est pas valide. second: There is an Error on line 1 : cvc-minInclusive-valid : La valeur '0' n'est pas un facet valide par rapport à minInclusive '1' pour le type 'positiveInteger'. There is an Error on line 1 : cvc-type.3.1.3 : La valeur '0' de l'élément 'quantity' n'est pas valide. ERROR_MESSAGE = null
Défaut du modèle (même fichier) : les erreurs d'une ligne s'accumulent d'une colonne à l'autre. Pour T-2, l'erreur de first est attribuée à second dans errorMessage, et répétée sous les deux noms dans XSD_ERROR_MESSAGE ; VALID vaut encore true. Une seule colonne XML par composant évite ces confusions.Defect of the template (same file): the errors of a row add up from one column to the next. For T-2, the error of first is attributed to second in errorMessage, and repeated under both names in XSD_ERROR_MESSAGE; VALID is still true. A single XML column per component avoids these mix-ups.
Une ligne dont la colonne xml vaut null, sans lien On Subjob Error :A row whose xml column is null, without an On Subjob Error link:
Exception in component tXSDValidator_1 (MyJob) java.lang.NullPointerException: Cannot invoke "String.getBytes(String)" because "<local7>.xml" is null at demo.myjob_0_1.MyJob.tFixedFlowInput_1Process(MyJob.java:1613) …
Le job s'arrête (code 1). Le texte de l'exception est celui de Java 21 ; une version ancienne de Java n'en donne pas. Filtrez les valeurs null avant le composant.The job stops (exit code 1). The exception text is the Java 21 one; an old Java version gives none. Filter out the null values before the component.
En mode fichier, un fichier invalide n'arrête pas le job. Reliez la suite par Run if avec ((Boolean) globalMap.get("tXSDValidator_1_VALID")), et le traitement des erreurs par la condition contraire.
In file mode, an invalid file does not stop the job. Connect the rest with Run if and ((Boolean) globalMap.get("tXSDValidator_1_VALID")), and the error handling with the opposite condition.
Après chaque changement de mode, et après une modification du flux entrant, recopiez son schéma dans le tXSDValidator : sans colonnes, il laisse tout passer sans rien valider. After each mode change, and after a change of the incoming flow, copy its schema again into the tXSDValidator: without columns, it lets everything through without validating anything.
Le validateur du JDK charge aussi les schémas cités par le XSD (xs:include, xs:import), qui peuvent désigner une adresse web. Sur un serveur sans accès à Internet, gardez des copies locales et des chemins relatifs entre elles (non essayé ici : nos XSD étaient autonomes).
The JDK validator also loads the schemas cited by the XSD (xs:include, xs:import), which may designate a web address. On a server without Internet access, keep local copies and relative paths between them (not tried here: our XSD files were self-contained).
Fichier absent, XSD introuvable, XML mal formé ou contenu non conforme donnent tous VALID = false. Le début de XSD_ERROR_MESSAGE les distingue : schema_reference.4, (Le fichier spécifié est introuvable), Fatal Error ou cvc-….
Missing file, XSD not found, malformed XML or non-compliant content all give VALID = false. The start of XSD_ERROR_MESSAGE tells them apart: schema_reference.4, the file-not-found text of the system, Fatal Error or cvc-….
tDTDValidator · valider un fichier XML par une DTDvalidate an XML file with a DTDtXSLT · transformer un XML par une feuille XSLtransform an XML with an XSL stylesheettFileInputXML · lire les lignes d'un fichier XMLread the rows of an XML filetExtractXMLField · lire le XML d'une colonneread the XML of a columntWriteXMLField · écrire du XML dans une colonnewrite XML into a columntFileOutputXML · écrire des lignes dans un fichier XMLwrite rows to an XML file