Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

message "Error Transforming XML" is not removed #431

Open
Pierre-de-la-Verre opened this issue Dec 19, 2024 · 5 comments
Open

message "Error Transforming XML" is not removed #431

Pierre-de-la-Verre opened this issue Dec 19, 2024 · 5 comments

Comments

@Pierre-de-la-Verre
Copy link

Sometimes I'm making bad XSLT and get this message:
Image
That's OK, but when I fix the XSLT and start to "Transform" again, the message stays on screen while the transformation is working and done. I think it should be remeoved in this case.

@lovettchris
Copy link
Member

I could not reproduce this just now on version 2.9.0.16, I performed these steps:

  • load hamlet.xml
  • modify willy.xsl adding invalid "name" attribute to one of the xsl:apply-templates elements
  • click the XSL Output tab
  • note the error appears
  • fix willy.xsl in a different text editor and save it.
  • Click Transform button again
  • Note the correct HTML appears.
  • I was then able to toggle the error saving the xslt each time and each time the Transform button did the right thing.

Note: I tried this with WebView2 and WinformsWebBrowser both behaved correctly...

Can you provide details steps you followed and perhaps the xml/xslt if you can share it?

@Pierre-de-la-Verre
Copy link
Author

Hi Chris,
I will try to report more this Monday. In any case - the XML had 25-40 MB and the output was creating a file. Maybe that's the point - "when creating a file it does not refresh the display"??

@Pierre-de-la-Verre
Copy link
Author

I just see that it a a timing problem.
Image

  • open a big XML (40 MB)
  • open a bad coded XSLT and Transform: you will get the message
  • fix the bad code in an editor and press "transform" again:
  • the message stays
  • the progress bar of transformation is displayed
  • finally the transformation is done, after a few seconds the error message disappears and is replaced be the transformed data

BTW:
I tested with Hamlet and Willy, then I open a c:\some\strange\file.xml. Then the "XSL Output tab" displayed "File c:\some\strange\willy.xsl was not found"

@lovettchris
Copy link
Member

lovettchris commented Dec 24, 2024

Yes that makes sense, I could "clear" the transform window before starting the new transform, especially in the case where it is displaying an error message.

The second problem is perhaps a little bit by design, you may have 10 xml documents all wanting to use the same transform so it remembers the XSLT field (in this case willy.xsl). But if your new xml is in a different location and the relative path to willy.xsl doesn't work anymore then yes that is not very useful. To fix that I could do one of the following:

  1. clear the transform field when you load a new XML document - but only if that value came from an xsl-transform tag in the previous document. If you type something into the field yourself, then you might want it to remember the value, but also remember the full path so that it can still find this transform when you load a new XML document.

and/or ?

  1. only remember the value you typed as an association with a specific XML document, so if you load a new XML document then clear the transform field if it has no xsl-transform instruction and no previous association with an XSLT that you created manually?
    And should the association be by actual xml filename or should it be with the root namespace of the "type" of xml document...?

Which do you prefer here? Other ideas?

@Pierre-de-la-Verre
Copy link
Author

Hi Chris
the "clearing" would be fine. Thanks.

The other question - "1 or/and 2" - can not be answered by me. Both sounds reasonable ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants