开发者

XML name space and stylesheet

Can some one please explain me relation between namespaces defined in xml, xsd and xsl ( stylesheet)?

My XSL is not working if I use default namespace.

Namespace in I have used

in XSD

<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:acmt.010.001.01" 
 xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" 
 targetNamespace="urn:iso:std:iso:20022:tech:xsd:acmt.010.001.01">

in XML

<Document 
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:acmt.010.001.01 acmt010.xsd" 
xmlns="urn:iso:std:iso:20022:tech:xsd:acmt.010.001.01" 
xmlns:xs开发者_Go百科i="http://www.w3.org/2001/XMLSchema-instance"
> 

In XSL

<xsl:stylesheet version="1.0" 
xmlns:xsi="urn:iso:std:iso:20022:tech:xsd:acmt.010.001.01" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:acmt.010.001.01 file:/C:/xml/working/testing/acmt.010.001.01.xsd" 
>

My XSL transformation is not working.

However if I change my namespace in xml to

<Document 
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:acmt.010.001.01 acmt010.xsd" 
xmlns:xsl="urn:iso:std:iso:20022:tech:xsd:acmt.010.001.01" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 

Then transformation is working but xml editior tool is giving warning "cvc-elt.1: The element declaration was not found for root element ".

can some help me with this?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜