Hallo Forum,
ich erhoffe mir Hilfe bei der Verarbeitung des folgenden XML-Dokument
mit javax.xml.xpath.XPath.
Mit der Methode selectNodeList(contextNode, xpath, [namespaceNode])
kann ich mit xpath=//* alle Elemente erfassen.
Möchte ich aber ein bestimmtes Element abgreifen, z.B. xpath=//ColorPool/Color, bekommen ich keine Elemente zurückgeliefert.
Meine Vermutung ist, dass die Namensräume das Problem verursachen,
kann aber keine Lösung finden. Das Präfix jdf: ist nur Versuchweise definiert.
Ich wäre für jede Hilfe dankbar.
Code:
<?xml version="1.0" encoding="UTF-8"?><Resources>
<jdf:RunList xmlns:jdf="http://www.CIP4.org/JDFSchema_1_1" Class="Parameter" ID="RNL000_D" Status="Unavailable"/>
<jdf:RunList xmlns:jdf="http://www.CIP4.org/JDFSchema_1_1" Class="Parameter" ID="RNL000_M" Status="Unavailable"/>
<jdf:Layout xmlns:jdf="http://www.CIP4.org/JDFSchema_1_1" Class="Parameter" ID="LAY000" Name="CoverLayout" Status="Unavailable">
<Signature xmlns="http://www.CIP4.org/JDFSchema_1_1" Name="SIG1059600001">
<Sheet Name="SHT1059600001">
<Media BackCoatings="Coated" Brand="Machinegestreken gesatineerd houtvrij WIT" Class="Consumable" DescriptiveName="Machinegestreken gesatineerd houtvrij WIT 520x360 mm 100 grs" Dimension="1474 1020" FrontCoatings="Coated" Grade="1" GrainDirection="LongEdge" ID="PAP351052N2HA" MediaType="Paper" MediaUnit="Sheet" ProductID="PAP351052N2HA" Status="Available" Thickness="110" Weight="100"/>
<Surface Side="Front"/>
</Sheet>
</Signature>
</jdf:Layout>
<jdf:ColorantControl xmlns:jdf="http://www.CIP4.org/JDFSchema_1_1" Class="Parameter" DescriptiveName="Colors of the job" ID="ColorantControl" Status="Available">
<ColorantParams xmlns="http://www.CIP4.org/JDFSchema_1_1">
<SeparationSpec Name="Cyan"/>
<SeparationSpec Name="Magenta"/>
<SeparationSpec Name="Yellow"/>
<SeparationSpec Name="Black"/>
</ColorantParams>
<ColorPool xmlns="http://www.CIP4.org/JDFSchema_1_1" Class="Parameter" DescriptiveName="Colors for the job" ID="ColorPool" Status="Available">
<Color CMYK="1 0 0 0" Name="Cyan"/>
<Color CMYK="0 1 0 0" Name="Magenta"/>
<Color CMYK="0 0 1 0" Name="Yellow"/>
<Color CMYK="0 0 0 1" Name="Black"/>
</ColorPool>
</jdf:ColorantControl>
<jdf:InterpretingParams xmlns:jdf="http://www.CIP4.org/JDFSchema_1_1" Class="Parameter" ID="REPPAP351052N2HAPlate000001" Status="Available">
<Media xmlns="http://www.CIP4.org/JDFSchema_1_1" BackCoatings="Coated" Brand="Machinegestreken gesatineerd houtvrij WIT" Class="Consumable" DescriptiveName="Machinegestreken gesatineerd houtvrij WIT 520x360 mm 100 grs" Dimension="1474 1020" FrontCoatings="Coated" Grade="1" GrainDirection="LongEdge" ID="PAP351052N2HA" MediaType="Paper" MediaUnit="Sheet" ProductID="PAP351052N2HA" Status="Available" Thickness="110" Weight="100"/>
<Media xmlns="http://www.CIP4.org/JDFSchema_1_1" Brand="SuperPlates" Class="Consumable" DescriptiveName="Plate" Dimension="1874 1420" ID="Plate000001" MediaType="Plate" ProductID="Plate000001" Status="Available" Thickness="200"/>
</jdf:InterpretingParams>
<jdf:Media xmlns:jdf="http://www.CIP4.org/JDFSchema_1_1" Class="Consumable" DescriptiveName="ImpoProof" ID="ImpoProof01" MediaType="Paper" Status="Available"/>
<jdf:ExposedMedia xmlns:jdf="http://www.CIP4.org/JDFSchema_1_1" SheetName="SHT1059600001">
<ExposedMedia xmlns="http://www.CIP4.org/JDFSchema_1_1" Side="Front"/>
</jdf:ExposedMedia>
</Resources>