Estou implementando um aplicação que gera um arquivo XML para ser validada na receita federal (NFe) mas estou na duvida de como declarar esse schemaLocation
<nfeProc xmlns="http://www.portalfiscal.inf.br/nfe" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" versao="1.10">
- <NFe xmlns="http://www.portalfiscal.inf.br/nfe" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.portalfiscal.inf.br/nfe/enviNFe_v1.12.xsd">
Element nfeProc = new Element("nfeProc");
nfeProc.setAttribute("versao","1.10");
nfeProc.setNamespace(Namespace.getNamespace("http://www.portalfiscal.inf.br/nfe"));
Namespace ds = Namespace.getNamespace("ds", "http://www.w3.org/2000/09/xmldsig#");
nfeProc.addNamespaceDeclaration(ds);
Namespace xsi = Namespace.getNamespace("xsi","http://www.w3.org/2001/XMLSchema-instance");
nfeProc.addNamespaceDeclaration(xsi);
Document doc = new Document(nfeProc);
nfeProc.addContent(new GenerateNFe().getElement());
public class GenerateNFe implements InterfaceNFe{
public Element getElement() {
Element NFe = new Element("NFe");
NFe.addContent(new GenerateInfNFe().getElement());
return NFe;
}
}
Obrigado.