Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it L'avatar di wegawhite
    Registrato dal
    Aug 2004
    Messaggi
    1,400

    Modificare XML tramite XSLT

    Ciao a tutti.

    Ho un file XML (book) che ho bisogno di modificare prima di creare un file XML in output.

    Il file di trasformazione RSS91.xslt fa parte del lavoro, ma ho bisogno di fare un passo avanti che è dove sto incontrando difficoltà.

    In C# sto usando l'oggetto XslCompiledTransform per la trasformazione e questo non funziona perché l'output del file XML è vuoto ...

    Sapreste aiutarmi a capire dove sbaglio?

    code behind
    codice:
    XslCompiledTransform transform = new XslCompiledTransform();
    transform.Load(Server.MapPath("~/RSS91.xslt"));
    transform.Transform(Server.MapPath("~/book.xml"), Server.MapPath("~/output.xml"));
    RSS91.xslt
    codice:
    <?xml version="1.0"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="html" indent="yes"/>
      <xsl:param name="title"/>
      <xsl:template match="rss">
        <xsl:for-each select="channel/item">
          <br>
            <strong>
              <a href="{link}" target="_main">
                <xsl:value-of select="title"/>
              </a>
            </strong>
            <br></br>
            <xsl:value-of select="description" disable-output-escaping="yes"/>
          </br>
          <br></br>
          <xsl:value-of select="pubDate"/>
          <br></br>
        </xsl:for-each>
      </xsl:template>
      <xsl:template match="description">
        <br>
          <xsl:value-of select="."/>
        </br>
      </xsl:template>
    </xsl:stylesheet>
    book.xml
    codice:
    <?xml version="1.0" encoding="utf-8" ?>
    <rss>
      <title></title>
    </rss>
    Ultima modifica di wegawhite; 21-03-2014 a 15:15

  2. #2
    I want to change from one XML (XHTML) file to another using XSLT.

    natural testosterone boosters reviews
    Ultima modifica di harrietjenning; 14-04-2014 a 10:18

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.