Jump to content

SUBIECTE NOI
« 1 / 5 »
RSS
Ce preferați: produse mai scumpe ...

Demagnetizare (minimala) ori ba?

Cum pot sa vad pe un proiector pr...

Joc Drone
 Dropshipping

Sfat achizitie AC Gree Fairy vs P...

MONITOR LG fara sonor !

Batalia pentru Bucuresti - ND, Fi...
 Identificare font

problema ping in jocuri online

Problema calculator

Samsung Galaxy A35
 Sfat pentru aprinderea automata a...

Rfg crescut

Cum reactivez Google Maps?

Conectare tableta X220la Tv
 

Warning: DOMDocument::relaxNGValidate() [...] xmlRelaxNGParse: article.xml is empty

- - - - -
  • Please log in to reply
1 reply to this topic

#1
OriginalCopy

OriginalCopy

    I'm harmful, fear me please! :))

  • Grup: Senior Members
  • Posts: 27,268
  • Înscris: 10.08.2006
//output:
Warning: DOMDocument::relaxNGValidate() [domdocument.relaxngvalidate]: xmlRelaxNGParse: /home/flav/public_html/workspace/merlin/validation/article.xml is empty in /home/flav/public_html/workspace/merlin/validation/validate.php on line 9

Warning: DOMDocument::relaxNGValidate() [domdocument.relaxngvalidate]: Invalid RelaxNG in /home/flav/public_html/workspace/merlin/validation/validate.php on line 9
bool(false)

//expected output:
bool(true)

Probabil am facut o eroare in fisierele xml, dar nu o vad, nici eu nici editorul xml! :)

sursele tuturor fisierelor(vor trebui modificate doar caile din codul php si ar trebui sa puteti reproduce):
	 1	//validate.php
	 2	<?php
	 3	$validator = 'article.xml';
	 4	$target = '../books/using_howto/book.xml';
	 5	$dom = new DomDocument();
	 6	$dom->load($target);
	 7	//$rng_src = file_get_contents($validator);
	 8	//var_dump($rng_src);
	 9	//var_dump($dom->relaxNGValidateSource($rng_src));
	10	var_dump($dom->relaxNGValidate($validator));
	11	?>
	12	 
	13	 
	14	//article.xml (the $validator)
	15	<?xml version="1.0" encoding="UTF-8"?>
	16	<element name="article" xmlns="http://relaxng.org/ns/structure/1.0">
	17		<element name="info">
	18			<element name="title"><text/></element>
	19			<optional><element name="subtitle"><text/></element></optional>
	20			<externalRef href="author.xml"/>
	21			<optional>
	22				<element name="revhist">
	23					<oneOrMore>
	24						<element name="revhistentry">
	25							<attribute name="version">
	26								<text/>
	27							</attribute>
	28							<attribute name="timestamp">
	29								<text/>
	30							</attribute>
	31							<interleave>
	32								<externalRef href="author.xml"/>
	33								<element name="shortdesc"><text/></element>
	34								<element name="longdesc"><text/></element>
	35							</interleave>
	36						</element>
	37					</oneOrMore>
	38				</element>
	39			</optional>
	40		</element>
	41		<element name="section">
	42			<text/>
	43		</element>
	44	</element>
	45	 
	46	 
	47	 
	48	 
	49	//author.xml (included in the file above):
	50	<?xml version="1.0" encoding="UTF-8"?>
	51	<grammar>
	52		<start>
	53			<group>
	54				<element name="authorgroup">
	55					<oneOrMore>
	56						<ref name="author"/>
	57					</oneOrMore>
	58				</element>
	59				<ref name="author"/>
	60			</group>
	61		</start>
	62	 
	63		<define name="author">
	64			<element name="author">
	65				<group>
	66					<interleave>
	67						<element name="surname"><text/></element>
	68						<element name="forename"><text/></element>
	69					</interleave>
	70					<text/>
	71				</group>
	72				<element name="email"><text/></element>
	73			</element>
	74		</define>
	75	</grammar>
	76	 
	77	 
	78	 
	79	//book.xml:
	80	<?xml version="1.0" encoding="UTF-8"?>
	81	<article>
	82		<info>
	83			<title>Title</title>
	84	<!--		 <subtitle></subtitle>  -->
	85			<authorgroup>
	86				<author>
	87					<surname>Foo</surname>
	88					<forname>Bar</forname>
	89				</author>
	90			</authorgroup>
	91			<revhist>
	92				<revhistentry version="0.1" date="timestamp">
	93					<author>
	94						<surname>Foo</surname>
	95						<forname>Bar</forname>
	96					</author>
	97					<shortdesc>a short description</shortdesc>
	98					<longdesc>a long description of the changes</longdesc>
	99				</revhistentry>
   100			</revhist>
   101		</info>
   102		<section>Hello</section>
   103	</article>


#2
OriginalCopy

OriginalCopy

    I'm harmful, fear me please! :))

  • Grup: Senior Members
  • Posts: 27,268
  • Înscris: 10.08.2006
[REZOLVAT]

erau cateva tipo, greseli banale (ex forname -> forename) dar cea mai "grava" era ca uitasem xmlns in author.xml

LE

self-note: externalRef'ed patterns fuck up the libxml2 error reporting.

Edited by OriginalCopy, 21 May 2008 - 21:33.


Anunturi

Chirurgia endoscopică a hipofizei Chirurgia endoscopică a hipofizei

"Standardul de aur" în chirurgia hipofizară îl reprezintă endoscopia transnazală transsfenoidală.

Echipa NeuroHope este antrenată în unul din cele mai mari centre de chirurgie a hipofizei din Europa, Spitalul Foch din Paris, centrul în care a fost introdus pentru prima dată endoscopul în chirurgia transnazală a hipofizei, de către neurochirurgul francez Guiot. Pe lângă tumorile cu origine hipofizară, prin tehnicile endoscopice transnazale pot fi abordate numeroase alte patologii neurochirurgicale.

www.neurohope.ro

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Forumul Softpedia foloseste "cookies" pentru a imbunatati experienta utilizatorilor Accept
Pentru detalii si optiuni legate de cookies si datele personale, consultati Politica de utilizare cookies si Politica de confidentialitate