Skip to main content
Inspiring
December 3, 2024
Answered

Error message after using XSLT to open XML

  • December 3, 2024
  • 2 replies
  • 579 views

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'

 

 

 

 

    This topic has been closed for replies.
    Correct answer 4XS Martin

    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

    2 replies

    4XS MartinAuthorCorrect answer
    Inspiring
    December 4, 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

    Matt-Tech Comm Tools
    Community Expert
    Community Expert
    December 3, 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
    Inspiring
    December 4, 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!