Jump to content

malbolgia

Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

malbolgia's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. the bottom one it gets misplaced solved had a wrong attribute in one of the divs
  2. Im making a new site, and the layout is working ok in ie, but firefox is missplacing a div. I dont know how to fix this. [a href=\"http://mattoidesign.com/cerracol/index.html\" target=\"_blank\"]http://mattoidesign.com/cerracol/index.html[/a] The design is awfull, but its the way they want it.
  3. thanks didnt know it was a reserved word :)
  4. im trying this query INSERT INTO character (charname, charborn, charqual, id) VALUES ('Snoopy', '2006-10-08', 'cool', 'Snoopy'); and i get this error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'character (charname, charborn, charqual, id) VALUES ('Snoopy', ' i cant seem to see whats wrong this is the table structure id varchar(50) charname varchar(60) charborn date charqual varchar(60)
  5. [code]<?php class Books extends DomDocument {     function __construct() {         //has to be called!         parent::__construct();     }          function addBook($isbn, $title, $name, $born, $dead, $charname, $charborn, $charqual){         $root = $this->createElement('library');                  $root->setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");             $root->setAttribute("xsi:SchemaLocation", "librarysch.xsd");             $root = $this->appendChild($root);         $bookelement = $this->createElement("book");         $bookelement->setAttribute("id", "b".$isbn);         $bookelement->setAttribute("available", "true");         /*isbn*/         $isbnspace = $this->createElement("isbn");         $isbnspace->appendChild($this->createTextNode($isbn));                 $bookelement->appendChild($isbnspace);         /*title*/         $titlespace = $this->createElement("title");         $titlespace->appendChild($this->createTextNode($title));         $titlespace->setAttribute("lang", "en");         $bookelement->appendChild($titlespace);         /*author*/         $authorspace = $this->createElement("author");         $temp = explode(" ", $name);         $authorspace->setAttribute("id", $temp[0]);         //name         $namespace = $this->createElement("name");         $namespace->appendChild($this->createTextNode($name));         $authorspace->appendChild($namespace);         //born         $bornspace = $this->createElement("born");         $bornspace->appendChild($this->createTextNode($born));         $authorspace->appendChild($bornspace);         //dead         $deadspace = $this->createElement("dead");             $deadspace->appendChild($this->createTextNode($dead));         $authorspace->appendChild($deadspace);           $bookelement->appendChild($authorspace);                 /*Character*/         $characterspace = $this->createElement("character");         $characterspace->setAttribute("id", $charname);         //name         $namespace = $this->createElement("name");         $namespace->appendChild($this->createTextNode($charname));         $characterspace->appendChild($namespace);         //born         $bornspace = $this->createElement("born");         $bornspace->appendChild($this->createTextNode($charborn));         $characterspace->appendChild($bornspace);         //qualificatiom         $qualspace = $this->createElement("qualification");         $qualspace->appendChild($this->createTextNode($charqual));         $characterspace->appendChild($qualspace);                       $bookelement->appendChild($characterspace);         //$dom->appendChild($bookelement);         $this->documentElement->appendChild($bookelement);     } } $doc = new DOMDocument('1.0'); $doc->formatOutput = true; $dom = new Books(); $isbn = stripslashes($_POST['isbn']); $title = stripslashes($_POST['title']); $name = stripslashes($_POST['name']); $born = stripslashes($_POST['born']); $dead = stripslashes($_POST['dead']); $charname = stripslashes($_POST['charname']); $charborn = stripslashes($_POST['charborn']); $charqual = stripslashes($_POST['charqual']); $dom->addBook($isbn, $title, $name, $born, $dead, $charname, $charborn, $charqual); $dom->schemaValidate('librarysch.xsd'); print $dom->save("newfile.xml"); print $dom->saveXML(); ?> [/code] im making a new xml file from a form submited by a user, everything works fine until i try to add the schema location and name space. Im trying to do this with this $root->setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); $root->setAttribute("xsi:SchemaLocation", "librarysch.xsd"); but i get Attribute "xmlns:xsi" not allowed how can i add schema information to the xml? and another question how do i add the stylesheet?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.