简体   繁体   中英

Validating Phing's build.xml using Netbeans

I have the following build.xml file in my project's root directory (the file is taken from Phing's manual ):

<?xml version="1.0" encoding="UTF-8"?> 
<?xml-model href="/usr/local/php/lib/php/data/phing/etc/phing-grammar.rng" 
            type="application/xml" 
            schematypens="http://relaxng.org/ns/structure/1.0" ?>

<project name="FooBar" default="hi">
    <target name="hi">
        <echo msg="Hiiiiiiiiiiiiiiii" />
    </target>
</project>

I changed

<?xml-model href="/usr/share/php5/PEAR/data/phing/etc/phing-grammar.rng" 
                    type="application/xml" 
                    schematypens="http://relaxng.org/ns/structure/1.0" ?>

to refer to the correct path on my filesystem and confirmed that the file actually exists.

The build.xml is working correctly from the terminal and the it prints hiiiiiiiiiiiii .

My problem is 2 things:

  1. When press validate file Netbeans gives the following error:

    XML validation started.
    Checking file:/usr/local/apache2/htdocs/testComposer/build.xml...
    cvc-elt.1: Cannot find the declaration of element 'project'. [6]
    XML validation finished.

  2. I can't get Netbeans to auto complete the predefined tasks in Phing.

It seems Netbeans can't read the phing-grammar.rng file although it exists and has read permissions.

Is this a limitation of Netbeans or am I doing something wrong?

The correct syntax is xlink: href. See example:

<?xml-model xlink:href="/your/path/to/phing-grammar.rng" type="application/xml" 
                    schematypens="http://relaxng.org/ns/structure/1.0" ?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM