How to change the prefix and name of an attribute in an XML tag in an NFS-e?

Asked

Viewed 263 times

1

Hello, I’m beginner in NFS-e development and I’m not able to change the prefix and attribute name below, I put in the code so that it was xsi, but regardless of what I put it generates the xml with d1p1. How to replace this d1p1 with xsi in its two occurrences?

<?xml version="1.0" encoding="UTF-8"?>
<EnviarLoteRpsEnvio xmlns="http://isscuritiba.curitiba.pr.gov.br/iss/nfse.xsd" xmlns:d1p1="http://www.w3.org/2001/XMLSchema-instance" d1p1:schemaLocation="http://isscuritiba.curitiba.pr.gov.br/iss/nfse.xsd">
<LoteRps Id="lote6014" versao="2.0">
      <NumeroLote>6014</NumeroLote>
      <Cnpj>0000000000</Cnpj>
      <InscricaoMunicipal>55114444</InscricaoMunicipal>
      <QuantidadeRps>1</QuantidadeRps>
      <ListaRps>
         <Rps>

Below is the code used to generate attributes in C#:

using System;
using System.Xml;
using System.Xml.Serialization;

namespace NFSE.Net.Layouts.CuritibaPr {
[System.Xml.Serialization.XmlRoot("EnviarLoteRpsEnvio", Namespace = "http://isscuritiba.curitiba.pr.gov.br/iss/nfse.xsd")]

public class EnviarLoteRpsEnvio
{
    public XmlSerializerNamespaces GetAdditionalNamespaces()
    {
        XmlSerializerNamespaces names = new XmlSerializerNamespaces();
        names.Add("", "http://www.w3.org/2001/XMLSchema-instance");
        names.Add("xsi", "http://isscuritiba.curitiba.pr.gov.br/iss/nfse.xsd");
        return names;
    }

       [XmlAttribute(AttributeName = "schemaLocation", Namespace = "http://www.w3.org/2001/XMLSchema-instance")]
       public string XSDSchemaLocation
       {
           get
           {
               return "http://isscuritiba.curitiba.pr.gov.br/iss/nfse.xsd";
           }     
           set
           { }
       }

Thank you.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.