Solved

Namespace for prefix 'dg' has not been declared Error

Posted on 2009-07-14
7
1,850 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
JQuery tracking event. 3 65
JQuery to parse xml string and get element by id 4 33
tutorial for ebay api 3 32
Best environment for cross platform web development? 5 42
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

816 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now