3

Can one help me understand (and fix this error). The error reads:

Warning: simplexml_load_file(): /home/jeffreycwitt/webapps/lombardpress_instances/petrusplaoul/lombardpress/phpfunctions/../../projectfiles/GitTextfiles/lectio1/lectio1.xml:2: parser warning : xmlParsePITarget: invalid name prefix 'xml' in home/jeffreycwitt/webapps/lombardpress_instances/petrusplaoul/lombardpress/phpfunctions/generalfunctions.php on line 47

The error seems to have something to do with my schema delcarations at the beginning of my xml files.

The declaration at the beginning of the file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="https://bitbucket.org/lombardpress/lombardpress-schema/raw/master/LombardPressODD.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?xml-model href="https://bitbucket.org/lombardpress/lombardpress-schema/raw/master/LombardPressODD.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
    <teiHeader>

I don't understand why I'm getting the warning. On systems where I can turn of "display_errors" this hasn't been a problem. But now I'm working with a system in which I do not have access to the php.ini file.

Ideally, I'd like to solve the problem so that I don't have any warnings. However, I need the schema declarations in place for other reasons.

Suggestions. jw

11
  • try to short the path of archive Commented Mar 10, 2014 at 20:12
  • Sorry, I'm not sure what that means. Commented Mar 10, 2014 at 20:12
  • you mean the path of the file being processed? That would be annoying as it would take some doing. Commented Mar 10, 2014 at 20:12
  • 1
    hmm, I'm not sure. Is there way to determine if simple_has a limit on the path length? And isn't the error complaining about the xml prefix within the document -- so it must be finding the document, right? Commented Mar 10, 2014 at 20:18
  • 1
    Seems like PIs that are prefixed with xml must be listed explicitly as exceptions. See e.g. git.gnome.org/browse/libxml2/tree/…, line 194. In your case, "xml-stylesheet" should already be defined - perhaps you can locate it? Commented Mar 11, 2014 at 12:35

1 Answer 1

6

There is one issue:

  • The <?xml prefix is reserved for the first line

Use an underscore as a simple fix:

<?_xml-model href="https://bitbucket.org/lombardpress/lombardpress-schema/raw/master/LombardPressODD.rng" type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>
<?_xml-model href="https://bitbucket.org/lombardpress/lombardpress-schema/raw/master/LombardPressODD.rng" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>

References

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.