Solved

Namespace for prefix 'dg' has not been declared Error

Posted on 2009-07-14
7
1,836 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AngularJS directive issue 6 65
Create and populate iFrame onClick of a button? 1 64
Post xml via PHP Soap Client 3 39
read an xml file in perl 2 15
Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

863 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

19 Experts available now in Live!

Get 1:1 Help Now