Visualizzazione dei risultati da 1 a 5 su 5

Discussione: include di xml

  1. #1

    include di xml

    ciao,
    il mio topic precedente riguardante questo argomento non riesco più a trovarlo.
    ma ho ancora il problema...

    come faccio a formattare un file xml attraverso un xsl lato server
    in modo da includerlo e a visualizzarlo correttamente in un file php?

    ciao a tutti

  2. #2

  3. #3
    ho letto ma non ho capito molto bene il suo funzionamento.
    ho inserito questo codice nella pagina php
    Codice PHP:
    // Load the XML source 
    $xml = new DOMDocument;
    $xml->load('News.xml');

    $xsl = new DOMDocument;
    $xsl->load('News.xsl');

    // Configure the transformer
    $proc = new XSLTProcessor;
    $proc->importStyleSheet($xsl); // attach the xsl rules

    echo $proc->transformToXML($xml); 
    che è l'esempio numero1

    ma testando la pagina in locale mi da questo errore:
    Codice PHP:
    Fatal error: Class 'XSLTProcessor' not found in D:/Siti Internet/[...]/index2.php on line 292 
    e on-line quest'altro:
    Codice PHP:
    Warningdomdocument() expects at least 1 parameter0 given in /web/htdocs/[...]/index2.php on line 285

    Fatal error
    Call to undefined methoddomdocument->load() in /web/htdocs/[...]/index2.php on line 286 
    Non riesco a capire.

  4. #4
    ho provato a incollare la definizione della classe XSLTProcessor nel mio script ovverp:
    Codice PHP:
      class XSLTProcessor   {
    /* Methods */
    string getParameter string $namespaceURI string $localName )
    bool hasExsltSupport void )
    void importStylesheet DOMDocument $stylesheet )
    void registerPHPFunctions ([ mixed $restrict ] )
    bool removeParameter string $namespaceURI string $localName )
    bool setParameter string $namespace string $name string $value )
    DOMDocument transformToDoc DOMNode $doc )
    int transformToURI DOMDocument $doc string $uri )
    string transformToXML DOMDocument $doc )

    ma non funziona.

    mi puoi dare un mano?

  5. #5
    ciao
    alla fine la soluzione l'ho trovata a questo indirizzo
    http://cmsproducer.com/XML-XSLT-XHTM...on-PHP-ASP-NET

    che utilizza il processore XSLTProcessor

    ciao ciao

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.