[xsl] Trying to build a schema and add a namespace

Subject: [xsl] Trying to build a schema and add a namespace
From: Dan Vint <dvint@xxxxxxxxx>
Date: Tue, 19 Apr 2005 15:54:44 -0700
I've got a setup where I have an XML file that contains information that I use to generate a variety of schemas. This process works fine until I need to add an import statement to the schema and the related namespace declaration.

My source file has a list of the target namespace and the files to import with their information and I'm able to process that at the right spot (I can create a message that kicks out the values I would like to have in the schema.) Here is what I'm trying to generate:

	xmlns:xsd="w3c url"
	xmlns="ACORD default URL"
          xmlns:acord-doc="ACORD doc URL"
          xmlns:xml="W3C url for XML namespace - need for xml:lang use"
	xmlns:jag="ACORD JAG URL"
	targetnamespace="ACORD default URL">
<xsd:import namespace="ACORD DOC URL"/>
<xsd:import namespace="W3C url for XML namespace - need for xml:lang use"/>
<xsd:import namespace="ACORD JAG URL"/>

I have one for-each loop before the IMPORT statements that can create the namespace declarations and another for-each loop that outputs the import statments.

The import statements are perfect but I can't come up with any way to get the namespace on the schema element as well as use the prefix that I want. If I hard code this information on the stylesheet attribute I get what I need, but I need some way to read this from the file I'm processing or worst case pass it in on the commandline.

Any ideas how I can do this and avoid hard coding the values in the stylesheet?

Danny Vint

Specializing in Panoramic Images of California and the West

voice: 510-522-4703

Current Thread