1

I am trying to upload an XML document using python and

arcpy.MetadataImporter_conversion

I keep getting an error:

Expected DTD markup was not found. Line 1, position 3. Failed to execute (MetadataImporter).

I think it's an issue with my XML document, but I'm not sure what. I've been using the same XML document to upload for 4 years now and now I'm getting this error. I haven't made any edits to the XML in that 4 years.

I've searched through the internet, but I haven't been able to come up with something that explains what the error is and how to resolve it. Does anyone know what this might mean?

  • Difficult to guess. Can you show at least the first line of your XML document? Does it start with <xml... ? – BradHards Oct 8 '13 at 20:57
  • Ran into the same issues as you did. I'm trying to do your workaround but need some clarification on what exactly you did as far as changing the reference in the xml. Did you change it to the filepath on your local directory where your FGDC markup is saved? Thanks, Rebecca – user22958 Oct 15 '13 at 17:13
  • Yes, That's where I stored it. Simply, just go and copy and paste into an XML editor (I used Notepad++) from the link I provided in the answer. Save it to any location that's a static location for you. Change the reference (Link in the header of the XML, ie "fgdc.gov/metadata/fgdc-std-001-1998.dtd") to the location of your new DTD and it should work fine. On a side note, it looks like the US has resolved their issues today and I would assume the website will be back up within the next couple days. – Mike Oct 16 '13 at 18:26
1

Ok, I hate to answer my own question so quickly, but I think I figured out the problem.

The first line of the XML reads as this:

?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE metadata SYSTEM "http://www.fgdc.gov/metadata/fgdc-std-001-1998.dtd"><metadata>

Turns out the fgdc website link in that line is referenced to the USGS.gov website. That website is down right now because of the US federal government shutdown. I believe the XML is trying to reference the DTD markup from that site and because the website is down, it's breaking the reference.

I found a copy of the fgdc-std-001-1998.dtd here :

I copied and pasted the markup into an xml editor, saved it as the same name on my local drive and changed the reference in the xml. This seems to work fine.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.