Reputation: 1833
Eclipse keeps reading me the Riot Act when I try to parse XML. It displays correctly to a webpage in the XSL, so I'm only including the XML and DTD. The errors are not exactly helpful, "Content type SoftWares must match SoftWare." If I'm getting this right, my DTD declares that one child element is SoftWare, which in turn has four children elements with three optional attributes. The XML Outline on the right-hand side looks good in Eclipse, but it keeps throwing "NULL POINTER" errors every five seconds. I'm not sure what's wrong with my code.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE SoftWares SYSTEM "Software.dtd">
<?xml-stylesheet type="text/xsl" href="Software.xsl"?>
<SoftWares>
<SoftWare>
<Name>Photoshop</Name>
<OS>Linux,Mac,Windows</OS>
<Price>$500</Price>
<Category>PhotoEditing</Category>
</SoftWare>
<SoftWare>
<Name>GIMP</Name>
<OS>Linux,Mac,Windows</OS>
<Price>$0</Price>
<Category>PhotoEditing</Category>
</SoftWare>
<SoftWare>
<Name>Final Cut Pro X</Name>
<OS>Mac</OS>
<Price>$299</Price>
<Category>VideoEditing</Category>
</SoftWare>
<SoftWare OS="Mac,Windows" Price="$200" Category="WordProcessor">
<Name>MicroSoft Word</Name>
<OS>Mac, Windows</OS>
<Price>$200</Price>
<Category>WordProcessor</Category>
</SoftWare>
<SoftWare OS="Linux,Mac,Windows" Price="$0" Category="WordProcessor">
<Name>LibreOffice</Name>
<OS>Linux,Mac,Windows</OS>
<Price>$0</Price>
<Category>WordProcessor</Category>
</SoftWare>
<SoftWare OS="Linux,Mac,Windows" Price="$2900" Category="3dModeling">
<Name>Cinema 4D</Name>
<OS>Linux,Mac,Windows</OS>
<Price>$2900</Price>
<Category>3dModeling</Category>
</SoftWare>
<SoftWare OS="Linux,Mac,Windows" Price="$0" Category="3dModeling">
<Name>Blender</Name>
<OS>Linux,Mac,Windows</OS>
<Price>$299</Price>
<Category>3dModeling</Category>
</SoftWare>
<SoftWare OS="Mac" Price="$500" Category="MusicMaker">
<Name>Logic Pro</Name>
<OS>Mac</OS>
<Price>$500</Price>
<Category>MusicMaker</Category>
</SoftWare>
<SoftWare OS="Linux,Mac,Windows" Price="$500" Category="MusicMaker">
<Name>Ableton Live</Name>
<OS>Linux,Mac,Windows</OS>
<Price>$500</Price>
<Category>MusicMaker</Category>
</SoftWare>
<SoftWare OS="Linux,Mac,Windows" Price="$200" Category="MotionGraphics">
<Name>After Effects</Name>
<OS>Linux,Mac,Windows</OS>
<Price>$200</Price>
<Category>MotionGraphics</Category>
</SoftWare>
<SoftWare OS="Mac" Price="$79" Category="MotionGraphics">
<Name>Motion</Name>
<OS>Mac</OS>
<Price>$79</Price>
<Category>MotionGraphics</Category>
</SoftWare>
<SoftWare OS="Linux,Mac,Windows" Price="$79" Category="ProgrammingSoftware">
<Name>Sublime Text</Name>
<OS>Linux,Mac,Windows</OS>
<Price>$79</Price>
<Category>ProgrammingSoftware</Category>
</SoftWare>
<SoftWare OS="Linux,Mac,Windows" Price="$0" Category="ProgrammingSoftware">
<Name>Eclipse</Name>
<OS>Linux,Mac,Windows</OS>
<Price>$0</Price>
<Category>ProgrammingSoftware</Category>
</SoftWare>
<SoftWare OS="Linux" Price="$0" Category="ProgrammingSoftware">
<Name>Geany</Name>
<OS>Linux</OS>
<Price>$0</Price>
<Category>ProgrammingSoftware</Category>
</SoftWare>
</SoftWares>
And the DTD:
<!ELEMENT SoftWares (SoftWare)>
<!ELEMENT SoftWare (Name,OS,Price,Category)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT OS (#PCDATA)>
<!ELEMENT Price (#PCDATA)>
<!ELEMENT Category (#PCDATA)>
<!ATTLIST SoftWare OS CDATA #IMPLIED>
<!ATTLIST SoftWare Price CDATA #IMPLIED>
<!ATTLIST SoftWare Category CDATA #IMPLIED>
Upvotes: 0
Views: 161