Validating XML Schema

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I am trying to use php to validate a document using it's schema.

I keep getting Warning: Element 'Invoices': No matching global
declaration available.

My xsd has

<?xml version="1.0" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
targetNamespace="http://www.mysite.com";
xmlns="http://www.mysite.com"; elementFormDefault="qualified">
<xs:element name="Invoices" type="InvoicesType"/>
<xs:complexType name="InvoicesType">
		<xs:element name="Invoice" type="xs:string"/>
</xs:complexType>
</xs:schema>

The xml test

<?xml version="1.0" ?>
<Invoices>
	<Invoice>10</Invoice>
</Invoices>

The php

$xml = new DOMDocument();
$xml->load( 'invoice.xml' );
if ($xml->schemaValidate("invoice.xsd"))
{
     echo "Validated OK" ;
} else 
{
     echo "Validate FAILED";
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux