Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problems with nested xsd schema in Design

Hi experts,

I'm developing a new sender interface in which we receive an xml file.

Other party gave us xsd schema to use in interface design.

My problem is that they gave us 2 schemas, and Schema B is nested into Schema A, and Schema A has tag named "cfdi" and Schema B has tag named "tfd"

This are the first lines of schema A:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:cfdi="http://www.sat.gob.mx/cfd/3" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.sat.gob.mx/cfd/3" elementFormDefault="qualified" attributeFormDefault="unqualified">

<xs:element name="Comprobante">

This are the first lines of schema B:

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tfd="http://www.sat.gob.mx/TimbreFiscalDigital" targetNamespace="http://www.sat.gob.mx/TimbreFiscalDigital" elementFormDefault="qualified" attributeFormDefault="unqualified">

<xs:element name="TimbreFiscalDigital">

I've tried to inserto Schema B as an element of Schema A, but I'm not sure that is the correct way to proceed, I've problem with the different names of tags (cfdi and tfd) can you help me?

Thanks

Fabio

Former Member replied

Hi

Two methods to insert one xsd into another.

<xsd:include schemaLocation="pathToFile"> 
should be used for including files of the same namespace.

<xsd:import namespace="namespace" schemaLocation="pathToFile"> 
should be used for include files in a different namespace.
Usually you will specify the namespace given as the targetNamespace
of the imported schema.

*source website: http://stackoverflow.com/questions/332792/can-i-have-one-xml-schema-xsd-include-another-xml-schema

regards

Ramesh

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question