![]() |
![]() |
![]()
Post
#1
|
|
![]() Grupa: Zarejestrowani Postów: 521 Pomógł: 0 Dołączył: 3.11.2003 Skąd: 3city Ostrzeżenie: (0%) ![]() ![]() |
Mam sobie plik ze XSchemą (test.xsd):
[xml:1:7fbe2a065e]<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="test"> <xs:complexType> <xs:sequence> <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>[/xml:1:7fbe2a065e] Obok mam plik XML (test.xml): [xml:1:7fbe2a065e]<?xml version="1.0"?> <test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="test.xsd"> <foo> <bar>1</bar> <bar>2</bar> </foo> </test>[/xml:1:7fbe2a065e] I teraz plik php, w którym waliduję jedno z drugim: [php:1:7fbe2a065e]<?php $dom = new DomDocument(); $dom->load('test.xml'); $dom->schemaValidate('test.xsd'); ?>[/php:1:7fbe2a065e] Wynik: Warning: Element test content check failed in E:htdocsroottestsxsanyindex.php on line 6 Jakim prawem?! Testowałem online, i przy użyciu desktopowych edytorów, i to powinno być poprawne. Albo ja nie kumam XML, albo php nie kuma xs:any. Any ideas? |
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Zarejestrowani Postów: 521 Pomógł: 0 Dołączył: 3.11.2003 Skąd: 3city Ostrzeżenie: (0%) ![]() ![]() |
Bump
![]() |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 18.07.2025 - 15:01 |