C# 将 Saxon XSLT 转换结果显示到当前 ASP.NET 容器页面

C# Display Saxon XSLT transformation result to current ASP.NET container page

我要对其应用 XML 和 XSLT v2.0 转换。 我需要将生成的 HTML(本质上是 table 发送通知文档的结构)输出到容器页面。 容器页面是一个 ASP.NET 页面,带有一些控件和一个 Tab 控件(来自 Telerik),我想用它来放置最终文档以供查看。

我的问题是从 <html> 标记开始转换 returns 一个完整的 HTML 页面。 如何只过滤我需要的内容?

在另一个类似的项目中,我使用 ASP.NET Xml 服务器控件来应用转换 (XSLT v1.0) 并自动获取文档视图。这是代码:

XmlDocument xd;
using (MemoryStream ms = new MemoryStream(file))
{
    xd = new XmlDocument();
    xd.Load(ms);
}
XDocument InvoiceXDocument = new XDocument();
using (var nodeReader = new XmlNodeReader(xd))
{
    nodeReader.MoveToContent();
    InvoiceXDocument = XDocument.Load(nodeReader);
}

invoiceViewer.TransformSource = @"C:\path\to\transformation.xslt";
invoiceViewer.DocumentContent = InvoiceXDocument.ToString(); // XDocument object of the XML invoice

因为我的新 XSLT 是 XSLT v2.0,所以我不能再使用它了。所以我切换到撒克逊。

这是我使用 Saxon 的实际转换代码:

Processor processor = new Processor();
XsltCompiler compiler = processor.NewXsltCompiler();
XsltExecutable executable;
executable = compiler.Compile(new Uri(xsltFilePath));

StringWriter output = new StringWriter();
Serializer serializer = new Serializer();
serializer.SetOutputWriter(output);

XsltTransformer transformer = executable.Load();
transformer.SetInputStream(input, new Uri("file:///XSLTValidURI"));
transformer.Run(serializer);

return output.ToString();

如何使用 Saxon 库获得相同的结果?

更新 2016/08/30

XML 文件来自 Peppol 欧洲商业文档服务(参见 PEPPOL

这是要改造的XML(有意大利语注释)。

<?xml version="1.0" encoding="UTF-8"?>
<DespatchAdvice xmlns="urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2" 
    xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2" 
    xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">
    <cbc:UBLVersionID>2.1</cbc:UBLVersionID>
    <cbc:CustomizationID>urn:www.cenbii.eu:transaction:biitrns016:ver1.0:extended:urn:www.peppol.eu:bis:peppol30a:ver1.0:extended:urn:www.ubl-italia.org:spec:ddt:ver2.1</cbc:CustomizationID>
    <cbc:ProfileID>urn:www.cenbii.eu:profile:bii30:ver2.0</cbc:ProfileID>
    <!--Identificativo DDT. Obbligatorio-->
    <cbc:ID>DDT-2015-123</cbc:ID>
    <!--Data DDT. Obbligatorio-->
    <cbc:IssueDate>2015-10-29</cbc:IssueDate>
    <!--Orario DDT. Opzionale. Se usato inserire informazione-->
    <cbc:IssueTime>08:00:50</cbc:IssueTime>
    <!--Campo note in testata. Opzionale. Se usato inserire informazione-->
    <cbc:Note>Prova Note in Testata</cbc:Note>
    <!--Identificativo riferimento ad un singolo ordine. Opzionale. Se usato inserire informazione-->
    <cac:OrderReference>
        <cbc:ID>ORD-2015-321</cbc:ID>
        <cbc:IssueDate>2015-10-25</cbc:IssueDate>
        <!--Tipo ordine. Opzionale. Se usato inserire informazione-->
        <cbc:OrderTypeCode listID="UNCL1001">221</cbc:OrderTypeCode>
    </cac:OrderReference>
    <!--Speditore. Organizzazione che fornisce la merce o servizi. Obbligatorio-->
    <cac:DespatchSupplierParty>
        <cac:Party>
            <cac:PartyIdentification>
                <!--CF PI speditore. Obbligatorio-->
                <cbc:ID schemeID="IT:VAT">IT123456789</cbc:ID>
            </cac:PartyIdentification>
            <!--Azienda speditore. Obbligatorio-->
            <cac:PartyName>
                <cbc:Name>Notier</cbc:Name>
            </cac:PartyName>
            <!--Contatto persona di riferimento. Opzionale. Se usato inserire informazione-->
            <cac:Contact>
                <cbc:Name>Magazzino</cbc:Name>
                <cbc:Telephone>05155999</cbc:Telephone>
                <cbc:Telefax>05155999</cbc:Telefax>
                <cbc:ElectronicMail>CasellaPostaSpeditore@indirizzo.it</cbc:ElectronicMail>
            </cac:Contact>
        </cac:Party>
    </cac:DespatchSupplierParty>
    <!--Consegnatario. Organizzazione alla quale verranno spediti i prodotti. Obbligatorio-->
    <cac:DeliveryCustomerParty>
        <cac:Party>
            <!--Codice IPA consegnatario Ausl Cesena. Opzionale. Se usato inserire informazione-->
            <cbc:EndpointID schemeID="IT:IPA">9921:IT0L06J9</cbc:EndpointID>
            <cac:PartyIdentification>
                <!--CF PI consegnatario. Obbligatorio-->
                <cbc:ID schemeID="IT:VAT">123456789</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyName>
                <!--Azienda consegnatario. Obbligatorio-->
                <cbc:Name>Nome Azienda Consegnatario</cbc:Name>
            </cac:PartyName>
            <!--Indirizzo consegnatario. Opzionale. Se usato inserire informazione-->
            <cac:PostalAddress>
                <cbc:ID>AB01</cbc:ID>
                <cbc:StreetName>Via</cbc:StreetName>
                <cbc:AdditionalStreetName>Inforazioni aggiuntive all'indirizzo</cbc:AdditionalStreetName>
                <cbc:CityName>Bologna</cbc:CityName>
                <cbc:PostalZone>40100</cbc:PostalZone>
                <cbc:CountrySubentity>BO</cbc:CountrySubentity>
                <cac:Country>
                    <cbc:IdentificationCode listID="ISO3166-1:Alpha2">IT</cbc:IdentificationCode>
                </cac:Country>
            </cac:PostalAddress>
        </cac:Party>
        <!--Contatto persona di riferimento. Opzionale. Se usato inserire informazione-->
        <cac:DeliveryContact>
            <!--Informazioni persona di riferimento. Opzionale. Se usato inserire informazione-->
            <cbc:Name>Nome Persona o Magazzino</cbc:Name>
            <cbc:Telephone>05155999</cbc:Telephone>
            <cbc:Telefax>05155999</cbc:Telefax>
            <cbc:ElectronicMail>CasellaPostaConsegnatario@indirizzo.it</cbc:ElectronicMail>
        </cac:DeliveryContact>
    </cac:DeliveryCustomerParty>
    <!--Acquirente. Chi acquista la merce. Opzionale. Se usato inserire informazione-->
    <cac:BuyerCustomerParty>
        <cac:Party>
            <cac:PartyIdentification>
                <!--CF PI acquirente. Obbligatorio-->
                <cbc:ID schemeID="IT:CF">123456789</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyName>
                <!--Azienda acquirente. Obbligatorio-->
                <cbc:Name>Nome Acquirente</cbc:Name>
            </cac:PartyName>
        </cac:Party>
    </cac:BuyerCustomerParty>
    <!--Venditore. Chi vende la merce o i servizi. Opzionale. Se usato inserire informazione-->
    <cac:SellerSupplierParty>
        <cac:Party>
            <cac:PartyIdentification>
                <!--CF PI venditore. Obbligatorio-->
                <cbc:ID schemeID="IT:VAT">IT123456789</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyName>
                <!--Azienda venditore. Obbligatorio-->
                <cbc:Name>Nome o Descrizione del Magazzino, Venditore</cbc:Name>
            </cac:PartyName>
            <!--Contatto persona di riferimento. Opzionale. Se usato inserire informazione-->
            <cac:Contact>
                <!--Infomrazioni Persona di Riferimento. Opzionale. Se usato inserire informazione-->
                <cbc:Name>Nome Persona o Magazzino di Riferimento se Presente</cbc:Name>
                <cbc:Telephone>05155999</cbc:Telephone>
                <cbc:Telefax>05155999</cbc:Telefax>
                <cbc:ElectronicMail>CasellaPostaVenditore@indirizzo.it</cbc:ElectronicMail>
            </cac:Contact>
        </cac:Party>
    </cac:SellerSupplierParty>
    <!--Committente. Chi eventualmente riceve e consuma la merce. Opzionale. Se usato inserire informazione-->
    <cac:OriginatorCustomerParty>
        <cac:Party>
            <cac:PartyIdentification>
                <!--CF PI committente. Obbligatorio-->
                <cbc:ID schemeID="IT:CF">123456789</cbc:ID>
            </cac:PartyIdentification>
            <cac:PartyName>
                <!--Azienda committente. Obbligatorio-->
                <cbc:Name>Nome o Descrizione del Magazzino, Committente</cbc:Name>
            </cac:PartyName>
        </cac:Party>
    </cac:OriginatorCustomerParty>
    <!--Gestione spedizione della merce. Opzionale. Se usato inserire informazione-->
    <cac:Shipment>
        <!--Identificatore spedizione, se non presente ID usare 'NA'. Obbligatorio-->
        <cbc:ID>AB01</cbc:ID>
        <!--Informazioni gestione spedizione. Opzionale-->
        <cbc:Information>Inserire Descrizione Spedizione</cbc:Information>
        <cbc:GrossWeightMeasure unitCode="KGM">100</cbc:GrossWeightMeasure>
        <cbc:GrossVolumeMeasure unitCode="MTQ">15</cbc:GrossVolumeMeasure>
        <cbc:TotalTransportHandlingUnitQuantity>25</cbc:TotalTransportHandlingUnitQuantity>
        <!--Informazioni di trasporto sulla spedizione. Opzionale. Se usato inserire informazione-->
        <cac:Consignment>
            <cbc:ID>SPED100</cbc:ID>
            <!--Descrizione del veicolo. Opzionale. Se usato inserire informazione-->
            <cbc:Information>Veicolo ad esempio: AUTOCARRO</cbc:Information>
            <!--Vettore, se diverso da speditore inserirlo. Opzionale. Se usato inserire informazione-->
            <cac:CarrierParty>
                <cac:PartyName>
                    <!--Reagione sociale del vettore. Opzionale. Se usato inserire informazione-->
                    <cbc:Name>Vettore: ad esempio SDA</cbc:Name>
                </cac:PartyName>
                <!--Informazioni autista. Opzionale. Se usato inserire informazione-->
                <cac:Person>
                    <cac:IdentityDocumentReference>
                        <!--Informazioni documento Autista. Opzionale. Se usato inserire informazione-->
                        <cbc:ID>PAT123456</cbc:ID>
                        <cbc:DocumentType>PATENTE</cbc:DocumentType>
                    </cac:IdentityDocumentReference>
                </cac:Person>
            </cac:CarrierParty>
        </cac:Consignment>
        <!--Gestione Ccnsegna della merce. Opzionale. Se usato inserire informazione-->
        <cac:Delivery>
            <!--Informazioni sulla consegna della merce. Opzionale. Se usato inserire informazione-->
            <cbc:TrackingID>Merce10</cbc:TrackingID>
            <!--Periodo stimato sulla consegna della merce. Opzionale. Se usato inserire informazione-->
            <cac:EstimatedDeliveryPeriod>
                <cbc:StartDate>2015-10-30 </cbc:StartDate>
                <cbc:StartTime>08:30:50</cbc:StartTime>
                <cbc:EndDate>2015-10-31</cbc:EndDate>
                <cbc:EndTime>12:30:50</cbc:EndTime>
            </cac:EstimatedDeliveryPeriod>
            <!--Evasione  della spedizione. Opzionale. Se usato inserire informazione-->
            <cac:Despatch>
                <!--Periodo e ora evasione spedizione effettiva. Opzionale. Se usato inserire informazione-->
                <cbc:ActualDespatchDate>2015-10-31</cbc:ActualDespatchDate>
                <cbc:ActualDespatchTime>16:30:30</cbc:ActualDespatchTime>
                <!--Informazioni indirizzo evasione spedizione effettiva. Opzionale. Se usato inserire informazione-->
                <cac:DespatchAddress>
                    <cbc:ID>234</cbc:ID>
                    <cbc:StreetName>Inserire Indirizzo Principale</cbc:StreetName>
                    <cbc:AdditionalStreetName>Inserire Informazioni Aggiuntive all'Indirizzo</cbc:AdditionalStreetName>
                    <cbc:CityName>Bologna</cbc:CityName>
                    <cbc:PostalZone>40100</cbc:PostalZone>
                    <cbc:CountrySubentity>BO</cbc:CountrySubentity>
                    <cac:Country>
                        <cbc:IdentificationCode listID="ISO3166-1:Alpha2">IT</cbc:IdentificationCode>
                    </cac:Country>
                </cac:DespatchAddress>
            </cac:Despatch>
        </cac:Delivery>
    </cac:Shipment>
    <!--Tabella prodotti richiesti. Obbligatorio-->
    <cac:DespatchLine>
        <!--Identificatore di riga. Obbligatorio-->
        <cbc:ID>1</cbc:ID>
        <!--Note di riga. Opzionale. Se usato inserire informazione-->
        <cbc:Note>Inserire Note</cbc:Note>
        <!--Unità di misura e quantità consegnata. Obbligatorio-->
        <cbc:DeliveredQuantity unitCode="NAR" unitCodeListID="UNECERec20">100</cbc:DeliveredQuantity>
        <!--Quantità inevasa. Opzionale. Se usato inserire informazione-->
        <cbc:OutstandingQuantity unitCode="NAR" unitCodeListID="UNECERec20">20</cbc:OutstandingQuantity>
        <!--Ragione o motivo per la quantità inevasa. Opzionale. Se usato inserire informazione-->
        <cbc:OutstandingReason>Inserire Motivazione: Ad esempio Difettosa</cbc:OutstandingReason>
        <!--Riferimento a più ordini. Opzionale. Se usato inserire informazione-->
        <cac:OrderLineReference>
            <!--Riferimento linea d'ordine. Se non valorizzato utilizzare 'NA'. Obbligatorio-->
            <cbc:LineID>1</cbc:LineID>
            <cac:OrderReference>
                <!--Riferimento all'ordine. Obbligatorio-->
                <cbc:ID>ORD-2015-321</cbc:ID>
                <cbc:IssueDate>2015-10-25</cbc:IssueDate>
                <cbc:OrderTypeCode listID="UNCL1001">221</cbc:OrderTypeCode>
            </cac:OrderReference>
        </cac:OrderLineReference>
        <!--Riferimenti aggiuntivi dalle righe dell’avviso spedizione. Opzionale. Se usato inserire informazione-->
        <cac:DocumentReference>
            <!--Riferimento Linea d'Ordine. Obbligatorio-->
            <cbc:ID>45</cbc:ID>
            <cbc:IssueDate>2015-09-30</cbc:IssueDate>
            <cbc:DocumentType>CIG</cbc:DocumentType>
        </cac:DocumentReference>
        <!--Riferimenti articolo su riga. Opzionale. Se usato inserire informazione-->
        <cac:Item>
            <!--Descrizione prodotto. Opzionale, se usato inserire valori-->
            <cbc:Name>ABBA 12CPR RIV 875MG 125MG</cbc:Name>
            <cbc:AdditionalInformation>Principio Attivo:AMOXICILLINA TRIIDRATA/POTASSIO CLAVULANATO</cbc:AdditionalInformation>
            <cac:SellersItemIdentification>
                <!--Codice prodotto. Identificatore dell’articolo secondo il Venditore. Obbligatorio-->
                <cbc:ID>100123</cbc:ID>
            </cac:SellersItemIdentification>
            <cac:StandardItemIdentification>
                <!--Codice prodotto. Identificatore standard per l’articolo. Obbligatorio.-->
                <cbc:ID schemeID="GTIN" schemeAgencyID="9" schemeAgencyName="GS1">036816015</cbc:ID>
            </cac:StandardItemIdentification>
            <!--Istanza specifica dell’articolo. Opzionale, se usato inserire valori-->
            <cac:ItemInstance>
                <!--Informazioni specifici dell'articolo. Opzionale, se usato inserire valori-->
                <cbc:ManufactureDate>2006-06-23</cbc:ManufactureDate>
                <cbc:BestBeforeDate>2020-12-31</cbc:BestBeforeDate>
                <cbc:SerialID>ITA00258</cbc:SerialID>
                <!--Lotto della merce. Opzionale, se usato inserire valori-->
                <cac:LotIdentification>
                    <cbc:LotNumberID>111222333</cbc:LotNumberID>
                    <cbc:ExpiryDate>2017-12-31</cbc:ExpiryDate>
                </cac:LotIdentification>
            </cac:ItemInstance>
        </cac:Item>
        <!--Informazioni particolari sulla spedizione. Opzionale, se usato inserire valori-->
        <cac:Shipment>
            <!--Informazioni sulla spedizione. Se non valorizzato utilizzare 'NA'. Opzionale, se usato inserire valori-->
            <cbc:ID>NA</cbc:ID>
            <cbc:HandlingCode listID="UNCL4079">2</cbc:HandlingCode>
            <!--Unità logistica di trasporto. Opzionale, se usato inserire valori-->
            <cac:TransportHandlingUnit>
                <cbc:ID schemeID="SSCC" schemeAgencyName="GS1">54321</cbc:ID>
                <!--Opzionale, se usato inserire valori-->
                <cbc:TransportHandlingUnitTypeCode listID="UNECERec21">CT</cbc:TransportHandlingUnitTypeCode>
                <cbc:HazardousRiskIndicator>false</cbc:HazardousRiskIndicator>
                <cbc:ShippingMarks>FIDIA FARMACEUTICI SpA</cbc:ShippingMarks>
                <!--Unità di misura. Opzionale, se usato inserire valori-->
                <cac:MeasurementDimension>
                    <cbc:AttributeID schemeID="UNCL6313">AAB</cbc:AttributeID>
                    <cbc:Measure unitCode="KGM">50</cbc:Measure>
                </cac:MeasurementDimension> 
            </cac:TransportHandlingUnit>
        </cac:Shipment>
    </cac:DespatchLine>
    <cac:DespatchLine>
        <!--Identificatore di riga. Obbligatorio-->
        <cbc:ID>2</cbc:ID>
        <!--Note di riga. Opzionale. Se usato inserire informazione-->
        <cbc:Note>Inserire Note</cbc:Note>
        <!--Unità di misura e quantità consegnata. Obbligatorio-->
        <cbc:DeliveredQuantity unitCode="NAR" unitCodeListID="UNECERec20">5</cbc:DeliveredQuantity>
        <!--Riferimento a più ordini. Opzionale. Se usato inserire informazione-->
        <cac:OrderLineReference>
            <!--Riferimento linea d'ordine. Se non valorizzato utilizzare 'NA'. Obbligatorio-->
            <cbc:LineID>2</cbc:LineID>
            <cac:OrderReference>
                <!--Riferimento all'ordine. Obbligatorio-->
                <cbc:ID>ORD-2015-321</cbc:ID>
                <cbc:IssueDate>2015-10-25</cbc:IssueDate>
                <cbc:OrderTypeCode listID="UNCL1001">221</cbc:OrderTypeCode>
            </cac:OrderReference>
        </cac:OrderLineReference>
        <!--Riferimenti aggiuntivi dalle righe dell’avviso spedizione. Opzionale. Se usato inserire informazione-->
        <cac:DocumentReference>
            <!--Riferimento Linea d'Ordine. Obbligatorio-->
            <cbc:ID>45</cbc:ID>
            <cbc:IssueDate>2015-09-30</cbc:IssueDate>
            <cbc:DocumentType>CIG</cbc:DocumentType>
        </cac:DocumentReference>
        <!--Riferimenti articolo su riga. Opzionale. Se usato inserire informazione-->
        <cac:Item>
            <!--Descrizione prodotto. Opzionale, se usato inserire valori-->
            <cbc:Name>MYLERAN*100CPR RIV 2MG</cbc:Name>
            <cbc:AdditionalInformation>Principio Attivo:BUSULFANO</cbc:AdditionalInformation>
            <cac:SellersItemIdentification>
                <!--Codice prodotto. Identificatore dell’articolo secondo il Venditore. Obbligatorio-->
                <cbc:ID>3698233</cbc:ID>
            </cac:SellersItemIdentification>
            <cac:StandardItemIdentification>
                <!--Codice prodotto. Identificatore standard per l’articolo. Obbligatorio.-->
                <cbc:ID schemeID="GTIN" schemeAgencyID="9" schemeAgencyName="GS1">024787018</cbc:ID>
            </cac:StandardItemIdentification>
            <!--Articoli pericolosi. Opzionale, se usato inserire valori-->
            <cac:HazardousItem>
                <!--Codifiche degli articoli pericolosi. Opzionale, se usato inserire valori-->
                <cbc:ID>3249</cbc:ID>
                <cbc:UNDGCode listID="UNCL8273">ADR</cbc:UNDGCode>
                <cbc:TechnicalName>Medicine, solid, toxic, n.o.s.</cbc:TechnicalName>
                <cbc:CategoryName>ANTIBLASTICI</cbc:CategoryName>
                <cbc:HazardClassID>6.1</cbc:HazardClassID>
            </cac:HazardousItem>
            <!--Istanza specifica dell’articolo. Opzionale, se usato inserire valori-->
            <cac:ItemInstance>
                <!--Informazioni specifici dell'articolo. Opzionale, se usato inserire valori-->
                <cbc:ManufactureDate>2010-05-01</cbc:ManufactureDate>
                <cbc:BestBeforeDate>2022-12-31</cbc:BestBeforeDate>
                <cbc:SerialID>xyz258471</cbc:SerialID>
                <!--Lotto della merce. Opzionale, se usato inserire valori-->
                <cac:LotIdentification>
                    <cbc:LotNumberID>12346987777</cbc:LotNumberID>
                    <cbc:ExpiryDate>2018-12-31</cbc:ExpiryDate>
                </cac:LotIdentification>
            </cac:ItemInstance>
        </cac:Item>
        <!--Informazioni particolari sulla spedizione. Opzionale, se usato inserire valori-->
        <cac:Shipment>
            <!--Informazioni sulla spedizione. Se non valorizzato utilizzare 'NA'. Opzionale, se usato inserire valori-->
            <cbc:ID>NA</cbc:ID>
            <cbc:HandlingCode listID="UNCL4079">2</cbc:HandlingCode>
            <!-- Dettaglio merci sulla temperatura Celsius o Fahrenheit. Opzionale, se usato inserire valori-->
            <cac:GoodsItem>
                <cac:Temperature>
                    <cbc:AttributeID>Conservazione</cbc:AttributeID>
                    <cbc:Measure unitCode="CEL">25</cbc:Measure>
                </cac:Temperature>
                <cac:MinimumTemperature>
                    <cbc:AttributeID>Trasporto</cbc:AttributeID>
                    <cbc:Measure unitCode="CEL">2</cbc:Measure>
                </cac:MinimumTemperature>
                <cac:MaximumTemperature>
                    <cbc:AttributeID>Trasporto</cbc:AttributeID>
                    <cbc:Measure unitCode="CEL">8</cbc:Measure>
                </cac:MaximumTemperature>
            </cac:GoodsItem>
            <!--Unità logistica di trasporto. Opzionale, se usato inserire valori-->
            <cac:TransportHandlingUnit>
                <cbc:ID schemeID="SSCC" schemeAgencyName="GS1">32569</cbc:ID>
                <!--Opzionale, se usato inserire valori-->
                <cbc:TransportHandlingUnitTypeCode listID="UNECERec21">CT</cbc:TransportHandlingUnitTypeCode>
                <cbc:HazardousRiskIndicator>true</cbc:HazardousRiskIndicator>
                <cbc:ShippingMarks>Marca Prodotto</cbc:ShippingMarks>
                <!--Unità di misura. Opzionale, se usato inserire valori-->
                <cac:MeasurementDimension>
                    <cbc:AttributeID schemeID="UNCL6313">AAB</cbc:AttributeID>
                    <cbc:Measure unitCode="KGM">50</cbc:Measure>
                </cac:MeasurementDimension> 
            </cac:TransportHandlingUnit>
        </cac:Shipment>
    </cac:DespatchLine>
</DespatchAdvice>

这是 XSLT 文件:UBL2.1_DespatchAdvice.xslt

我终于找到了无需编辑原始 XSLT 文件的解决方案。

我没有将输出放在 DocumentContent 属性 上的 <asp:Xml> 服务器控件中,而是使用 <asp:Literal> 控件和 Text 属性.

整个输出 HTML 将正确显示。