Solved

Namespace for prefix 'dg' has not been declared Error

Posted on 2009-07-14
7
1,906 Views
Last Modified: 2013-11-18
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
0
Comment
Question by:LarryAndro
  • 4
  • 2
7 Comments
 
LVL 1

Author Comment

by:LarryAndro
ID: 24853412
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.
0
 
LVL 11

Assisted Solution

by:kmartin7
kmartin7 earned 300 total points
ID: 24853685
Is the dg namespace declared in lint.xml?
0
 
LVL 1

Author Comment

by:LarryAndro
ID: 24853812
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

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 60

Accepted Solution

by:
Geert Bormans earned 200 total points
ID: 24854782
mmh, you are actually generating xslt by using xslt,
it is likely that the error occurs in the actual execution of the generated xslt.

when you create the root element for the generated stylesheet
(axsl:stylesheet) but that part of the stylesheet is not included,
you have to make sure that the namespace node for dg is copied there too.
That seems a likely cause to me
0
 
LVL 11

Assisted Solution

by:kmartin7
kmartin7 earned 300 total points
ID: 24854847
So lint.xml is actually a schematrob schema? What document(s) are you validating to this?

it is difficult to say from the files you provided where the error is occurring. I see you are using ant, java and even DTD, so it could be derived from any one of those points of contact. You do have the namespace declared in DataGen-datagen-schematron-xsl, so that isn't where the error is occurring (I don't think).

Sorry I couldn't be of more help.

kmartin7
0
 
LVL 1

Author Comment

by:LarryAndro
ID: 24854896
I will check out your comments tomorrow morning.  (I'll give points, even if I don't find the solution here.)
0
 
LVL 1

Author Comment

by:LarryAndro
ID: 24860547
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...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Grunt Copy file to another destination. 1 82
Help needed with Powershell  XML to MySQL 5 75
removing a class in javascript 4 73
Need a modeling tool 2 42
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question