Ankündigung

Einklappen

Sammelbestellung ETS6 Vollversionen aktiv!

Sammelbestellung für ETS6 Vollversionen (Prof., Home, Lite) mit 40% Rabatt aktiv! Infos im Forum!
Mehr anzeigen
Weniger anzeigen

schemeVersion nach XML-Tranformation wird nicht erkennt, obwohl vorhanden

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    schemeVersion nach XML-Tranformation wird nicht erkennt, obwohl vorhanden

    Hallo Leute,

    ich konnte leider keinen Beitrag zu meinem Problem finden und erstelle daher ein neues Thema.

    Ich bin ganz neu hier und hoffe, dass mir hier jemand weiterhelfen kann

    Ich möchte eine empfangene XML-Datei transformieren, was auch anscheinend erstmal klappt. Allerdings erhalte ich dann den Fehler, dass die schemaVersion nicht gefunden werden kann.

    Hier ist die XML-Datei, die ich erhalte:
    <?xml version="1.0" encoding="utf-8"?>
    <ale:PCReports xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" schemaVersion="1.1"
    creationDate="2015-02-23T15:51:26.947214+01:00" specName="XXXX"
    date="2015-02-23T15:51:26.947214+01:00" ALEID="XXXX"
    totalMilliseconds="2153" initiationCondition="REQUESTED"
    terminationCondition="DATA_AVAILABLE" xmlns:ale="urn:xxxxx:ale:xsd:1">
    <reports>
    <report reportName="PortStatusChange">
    <eventReports>
    <eventReport>
    <id>urn:XXXXX:ale:triggerort:Werk:in:3</id>
    <opReports>
    <opReport>
    <state>false</state>
    <opStatus>SUCCESS</opStatus>
    <opName>Read_IN_1</opName>
    </opReport>
    <opReport>
    <state>true</state>
    <opStatus>SUCCESS</opStatus>
    <opName>Read_IN_3</opName>
    </opReport>
    </opReports>
    </eventReport>
    </eventReports>
    </report>
    </reports>
    </ale:PCReports>

    und das ist die XSLT:
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:XXXXX="urn:XXXXX:ale:xsd:1"
    xmlns:ale="urn:XXXXX:ale:xsd:1">
    <xsl:template match="reports">
    <XXXXX:PCReports>
    <xsl:attribute name="schemaVersion">
    <xsl:value-of select="../@schemaVersion" />
    </xsl:attribute>
    <xsl:attribute name="creationDate">
    <xsl:value-of select="../@creationDate" />
    </xsl:attribute>
    <xsl:attribute name="specName">
    <xsl:value-of select="../@specName" />
    </xsl:attribute>
    <xsl:attribute name="date">
    <xsl:value-of select="../@date" />
    </xsl:attribute>
    <xsl:attribute name="ALEID">
    <xsl:value-of select="../@ALEID" />
    </xsl:attribute>
    <xsl:attribute name="totalMilliseconds">
    <xsl:value-of select="../@totalMilliseconds" />
    </xsl:attribute>
    <xsl:attribute name="initiationCondition">
    <xsl:value-of select="../@initiationCondition" />
    </xsl:attribute>
    <xsl:attribute name="terminationCondition">
    <xsl:value-of select="../@terminationCondition" />
    </xsl:attribute>
    <PCSpec>
    <reports>
    <extension>
    <xsl:copy-of select="." />
    </extension>
    </reports>
    </PCSpec>
    </XXXXX:PCReports>
    </xsl:template>
    </xsl:stylesheet>

    und das bekomme ich nach der Transformation:
    <?xml version="1.0" encoding="UTF-8"?>
    <ale:PCReports schemaVersion="1.1"
    creationDate="2015-02-23T15:51:26.947214+01:00" specName="XXXXX"
    date="2015-02-23T15:51:26.947214+01:00" ALEID="XXXXX"
    totalMilliseconds="2153" initiationCondition="REQUESTED"
    terminationCondition="DATA_AVAILABLE" xmlns:ale="urn:XXXXX:ale:xsd:1"
    xmlns:XXXXX="urn:XXXXX:ale:xsd:1">
    <PCSpec>
    <reports>
    <extension>
    <reports xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <report reportName="PortStatusChange">
    <eventReports>
    <eventReport>
    <id>urn:XXXXX:ale:triggerort:Werk:in:3</id>
    <opReports>
    <opReport>
    <state>false</state>
    <opStatus>SUCCESS</opStatus>
    <opName>Read_IN_1</opName>
    </opReport>
    <opReport>
    <state>true</state>
    <opStatus>SUCCESS</opStatus>
    <opName>Read_IN_3</opName>
    </opReport>
    </opReports>
    </eventReport>
    </eventReports>
    </report>
    </reports>
    </extension>
    </reports>
    </PCSpec>
    </ale:PCReports>

    Nach der Transformation möchte ich die Datei mit einem Java-Objekt auslesen und bekomme die folgende Fehlermeldung:
    Exhausted after delivery attempt: 1 caught: org.jibx.runtime.JiBXException: Missing required attribute "schemaVersion" (line 1, col 387)


    Kann mir hier jemand weiterhelfen? Liegt es an der Transformation oder am Java-Objekt?

    Danke im Voraus.

    Gruß
Lädt...
X