[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Namespace declaration - good practise
Hello ! I have a lot of XSL that process many business documents. Each XSL declares at least 15 different business namespaces, excluding technical namespaces (http://www.w3.org/1999/XSL/Transform, http://www.w3.org/2001/XMLSchema and so on). We have problems when creating a new XSL, in copy/paste namespace declarations, and refactoring (namespace modification) is almost impossible. So, I'd like to declare namespaces strings as constants, and use these constants in XSL. The only way I've found is to declare a DTD with entities, one entity per namespace : <?xml version="1.0" encoding="UTF-8"?> <!ENTITY nsXF "http://www.lefebvre-sarrut.eu/ns/xmlfirst"> <!ENTITY nsAdded "eu:lefebvre-sarrut:mcqueen:publication:added"> <!ENTITY nsXfPub "http://www.lefebvre-sarrut.eu/ns/xmlfirst/publication"> <!ENTITY nsEls "http://www.lefebvre-sarrut.eu/ns/els"> Then, use this DTD in my XSL : <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xsl:stylesheet SYSTEM "../../namespaces.dtd"> <xsl:stylesheet xmlns:xf="&nsXF;" xmlns:added="&nsAdded;" ...> Oxygen have a convinient completion on entities that simplifies declaration. Am I the only guy to do this ? Is it a good practise ? Best regards, Christophe
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|