2013-10-17 44 views
0

我使用ImageGlue從圖像讀取Exif數據。 ImageGlue成功獲取exif數據並返回一個xml字符串。當我嘗試使用一個XMLDocument加載XML字符串,它拋出的錯誤:XmlDocument.Loadxml System.Xml.XmlException:名稱不能以'8'字符開頭 - imageglue中的xml

Name cannot begin with the "8" character".

我知道什麼是XML的一部分,導致了錯誤,但我不知道這是否是同一個問題, xml或試圖加載的xmldocument對象。 XML在下面,導致錯誤的標記是最後一個: Industries,Inc.它不喜歡「8298」,如果我刪除它,它可以正常工作。 ImageGlue的問題是不是從Exif中生成正確的xml,還是XmlDocument對象(C#)沒有正確讀取它?

<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?> 
<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:exif=\"http://ns.adobe.com/exif/1.0/#\"> 
<rdf:Description> 
<dc:date>2013-10-17T14-08-19Z</dc:date> 
<dc:type>image</dc:type> 
<dc:format>image/jpeg</dc:format> 
<dc:source>Photo</dc:source> 
<exif:ImageWidth>4368 pixels</exif:ImageWidth>  
<exif:ImageLength>2912 pixels</exif:ImageLength>  
<exif:BitsPerSample>8,8,8</exif:BitsPerSample> 
<exif:Compression>6</exif:Compression> 
<exif:PhotometricInterpretation>2</exif:PhotometricInterpretation>  
<exif:Model>Canon EOS 5D</exif:Model>  
<exif:Orientation>Normal</exif:Orientation> 
<exif:SamplesPerPixel>3</exif:SamplesPerPixel>  
<exif:XResolution>72 pixels per inch</exif:XResolution>  
<exif:YResolution>72 pixels per inch</exif:YResolution>  
<exif:ResolutionUnit>inch</exif:ResolutionUnit>  
<exif:Software>Adobe Photoshop CS5 Windows</exif:Software>  
<exif:DateTime>2013:10:16 10:42:48</exif:DateTime>  
<exif:Artist>bobbi </exif:Artist>  
<exif:ThumbnailOffset>838</exif:ThumbnailOffset> 
<exif:ThumbnailLength>6049</exif:ThumbnailLength> 
<exif:Tag 8298>Industries, Inc.</exif:Tag 8298> 

回答

4

這是無效的XML - 這是ImageGlue不能生成正確的XML。它試圖使用「Tag 8298」的XML標籤名稱,但該空間不起作用,這意味着8298被解釋爲屬性名稱,該名稱不能以數字開頭。

+0

謝謝,標示爲答案! – TheRedDwarf

相關問題