Link to home
Start Free TrialLog in
Avatar of LarryAndro
LarryAndro

asked on

Namespace for prefix 'dg' has not been declared Error

When I run an ant task to generate XSLs, I get the following error...

    Namespace for prefix 'dg' has not been declared.

The error seems to be coming from the datagen-schematron.xsl file, but I am unsure of this.  I am attaching this file, and several other files I believe are pertinent.

I am very unfamiliar with this process, as I am simply running a process created by someone else.  I have only a modest amount of background knowledge.  Hopefully, someone can tell me what to check, study or do to solve this problem.
Buildfile: C:\eclipse\Workspace\datagen\build.xml
create-xsl:
check-lint-uptodate:
create-lint:
     [xslt] Transforming into C:\eclipse\Workspace\datagen\xsl-gen
     [xslt] Processing C:\eclipse\Workspace\datagen\template\lint.xml to C:\eclipse\Workspace\datagen\xsl-gen\lint.xsl
     [xslt] Loading stylesheet C:\eclipse\Workspace\datagen\lib\dev\schematron\datagen-schematron.xsl
     [xslt] : Error! Namespace for prefix 'dg' has not been declared.
     [xslt] Failed to process null
 
BUILD FAILED
C:\eclipse\Workspace\datagen\build.xml:79: The following error occurred while executing this line:
C:\eclipse\Workspace\datagen\build.xml:107: javax.xml.transform.TransformerException: java.lang.RuntimeException: Namespace for prefix 'dg' has not been declared.
 
Total time: 906 milliseconds

Open in new window

DataGen-build-xml
DataGen-gen-xml
DataGen-datagen-schematron-xsl
Avatar of LarryAndro
LarryAndro

ASKER

I forgot to mention that in the Datagen-Schematron.xsl file (attached) the 'dg' namespace appears to be declared.  So, I am unsure why the error message...

    Namespace for prefix 'dg' has not been declared.

is occurring.
SOLUTION
Avatar of kmartin7
kmartin7
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The top section of lint.xml is included in the code snippet section.  Whether the prefix="dg" line is proper declaring, I don't know.
<?xml version="1.0" encoding="UTF-8"?>
<!-- $Id: lint.xml,v 1.29 2005/06/21 18:20:52 kackley Exp $ -->
<schema 
    xmlns="http://www.ascc.net/xml/schematron"        
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >
  <title>Datagen validation schema</title>
  
  <ns prefix="dg" uri="http://vha.med.va.gov/gov/va/datagen"/>
...
...
...
...

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I will check out your comments tomorrow morning.  (I'll give points, even if I don't find the solution here.)
Even with the suggestions above, I am unable to determine the cause of my problem.  I am unsure how to proceed, and I am sure this is because of my lack of knowledge about most of the techniques being used.  (E.g., xslt translation.)  I will have to turn this over to others on my team more familiar with this problem.

I am awarding points.  And, thanks for responding...