Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Error message after using XSLT to open XML

Community Beginner ,
Dec 03, 2024 Dec 03, 2024

Hi,

 

I have a weird problem. I have a Structapps FM XML application that is using XSLT to transform an XML file into a structured FM document.

 

The XML files are exports from a database and I have 2 example files. One is working flawlessly without errors, the second one is producing some errors, which prompts FM to give out the error message that the XML file is not valid. When I click Ok to open it anyway the document is valid.

 

slightly obfuscated FM consol

XSL Transformation Log
Input: x:\xxx\xxx.xml
XSL:x:\xxx\xxx.xsl


XSL Processor Messages (Processor: SAXON)


Transformation Successful.

XML Read Report Log
Source Document: x:\xxx\xxx.xml

XML Parser Messages (Document Instance)
Error at file C:\Users\xxx\AppData\Local\Temp\FMT3F82.tmp, line 8, char 62, Message: no declaration found for element 'myRootElement'
Error at line 8, char 62, Message: attribute 'ID' is not declared for element 'myRootElement'
Error at line 8, char 62, Message: attribute 'language' is not declared for element 'myRootElement'
Error at line 8, char 62, Message: attribute 'type' is not declared for element 'myRootElement'

 

 

 

 

726
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Dec 04, 2024 Dec 04, 2024

Okay so I have identified the problem and luckily also the solution.

 

The problem was the xsi:noNamespaceSchemaLocation declaration in the original XML file. Eventhough I had a XSD file, FM seems to be unable to find it during the transformation progress.

 

To fix this I just edited my XSLT script to remove this attribute during the transformation which fixed this whole mess.

 

Thank you

Translate
Community Expert ,
Dec 03, 2024 Dec 03, 2024

So, the first problem I see is there's no question being asked...

Beyond that, are the error messages accurate? Are myRootElement, ID, language, and type declared in the XML?

 

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 03, 2024 Dec 03, 2024

Thank you for your reply! I completely forgot yesterday. So I have 2 questions:

 

1. Why does FM produce an error that my document is not valid, when in reality it clearly is?

2. How do I make this error not show up?

 

The attributes and the root element are declared everywhere they can be. In the EDD, XSD, DTD, I really don't know where else I could declare them.

Thank you in advance!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 04, 2024 Dec 04, 2024
LATEST

Okay so I have identified the problem and luckily also the solution.

 

The problem was the xsi:noNamespaceSchemaLocation declaration in the original XML file. Eventhough I had a XSD file, FM seems to be unable to find it during the transformation progress.

 

To fix this I just edited my XSLT script to remove this attribute during the transformation which fixed this whole mess.

 

Thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines