Einzelnen Beitrag anzeigen

Benutzerbild von Aenogym
Aenogym

Registriert seit: 7. Mär 2004
Ort: Schwerin
1.089 Beiträge
 
Delphi 7 Enterprise
 
#1

SelectSingleNode gibt nil, obwohl ich ein Node erwarte...

  Alt 25. Okt 2007, 11:56
Huhu DPler

ich bin seit langem mal wieder hier und habe auch gleich ein Problemchen
Es geht um eine SVG, die ich aus einem Adobe-Mars-Archiv extrahiert habe (Adobe Mars ist eine Technologie, die PDF-Dokumente mit allem Drum und Dran in XML abbildet).
Jedenfalls lade ich die SVG mithilfe des MSXML6-Parsers und möchte nun auf einen bestimmten Knoten zugreifen. Jedoch bekomme ich alsResultat immer nil

Die SVG:
XML-Code:
<?xml version="1.0" encoding="utf-8"?>
<svg xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:pdf="http://ns.adobe.com/pdf/2006" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" stroke="none" width="595" height="841">
   <defs>
      <color-profile name="cs-0" xlink:href="/color/cs-0.icc" pdf:Count="3" pdf:type="RGB" pdf:wp="0.9505 1 1.089" pdf:bp="0 0 0" pdf:r="0.4124 0.2126 0.0193" pdf:g="0.3576 0.7152 0.1192" pdf:b="0.1805 0.0722 0.9505"/>
      <pdf:Separation Name="cs-1" Colorant="HKS 66" AlternateSpace="cs-0">
         <pdf:TintTransform>
            <pdf:SampledFunction Domain="0 1" Range="0 1 0 1 0 1" Size="255" BitsPerSample="8" Order="linear" Encode="0 254" Decode="0 1 0 1 0 1">
               <pdf:File Name="/res/func-0.f0"/>
            </pdf:SampledFunction>
         </pdf:TintTransform>
      </pdf:Separation>
      <font-face font-family="F0">
         <font-face-src>
            <font-face-name name="AGaramond-Regular"/>
            <font-face-uri xlink:href="/font/f-0._sfnt"/>
         </font-face-src>
      </font-face>
      <font-face font-family="F1">
         <font-face-src>
            <font-face-name name="AGaramond-Semibold"/>
            <font-face-uri xlink:href="/font/f-1._sfnt"/>
         </font-face-src>
      </font-face>
      <clipPath id="cl-1">
         <path d="M0,841h595V0H0z"/>
      </clipPath>
      <clipPath id="cl-2">
         <path d="M0.015,840.99h594.99V0H0.015z"/>
      </clipPath>
   </defs>
   <g transform="matrix(1 0 0 -1 0 841)">
      <g clip-path="url(#cl-1)">
         <g clip-path="url(#cl-2)">
            <path stroke="rgb(0,0,0) device-color(DeviceGray,0)" stroke-width="0.5" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" d="M56.12,797H538"/>
            <text transform="matrix(1 0 0 -1 0 801.5599)" font-size="9.5" font-family="F0" fill="rgb(0,0,0) device-color(DeviceGray,0)" fill-rule="evenodd">
               <tspan x="56.14 60.889 100.0794 104.7239 110.993 116.5401 121.7925 127.045 132.5921 140.0297 145.7582 152.8443 157.4888 162.1333 168.7444 176.4004 182.527 188.0741 191.2841 196.9413 204.0274 211.465 218.5605 224.1075 231.5451 489.5204 494.165 500.586 506.2233 508.5688 511.1841 515.9332 519.0387 523.7878 528.5369 533.2859">64STELLENAUSSCHREIBUNGEN SVBl 2/2001</tspan>
            </text>
         </g>
      </g>
   </g>
</svg>
Mein Delphi-Code:
Delphi-Quellcode:
var
    xmldoc: IXMLDOMDocument3;
    tempnode: IXMLDOMNode;
//.....
xmldoc := CoDOMDocument60.Create();
        xmldoc.setProperty('NewParser', true);
        xmldoc.async := false;
        xmldoc.load(extractfilepath(paramstr(0))+'working\pg.svg');
        if xmldoc.parseError.errorCode = 0 then
        begin
          tempnode := xmldoc.documentelement.selectSingleNode('//text');
        end;
Ich möchte schlicht und einfach das erste <text>-Element bekommen, das im Dokument vorkommt....
Habt ihr eine Idee, was ich falsch mache?

Danke schonmal,
aeno
Steffen Rieke
Was nicht buzzt, wird buzzend gemacht!
http://blog.base-records.de
http://www.base-records.de
  Mit Zitat antworten Zitat