Subject: Re: [xsl] Running xsltproc does not produce any output From: "Piez, Wendell A. (Fed) wendell.piez@xxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 22 Jul 2024 15:37:41 -0000 |
Hello Jim, Congratulations on getting it to work so far. Others may have other advice, but I'd recommend continuing down the XSLT path here --- or at least looking. It's not that calling to Java wouldn't work (it might work fine), it's just that unless you can replace the XSLT altogether, it's adding complexity, whereas on the XSLT side all your functional requirements (as stated) are well within its capabilities. Going with XSLT I think you have two main issues, the first being the version of XSLT - whether to stick with XSLT 1.0 and the current stack, or maybe upgrade the stack? You mention Xalan but if Java is already in the picture, there is no technical reason (I could see) to exclude XSLT 3.0/3.1 solutions on Saxon whether 'bare' or supported by XProc, etc. The second issue is how you would develop and test your XSLT, adapting it to the problem. For interactive testing there are XSLT Fiddle applications you can try, although you need to take care as to the XSLT version / which engine is being used - for XSLT 1.0, client-side runtimes are now easier to find or set up. (Ask again if you need recommendations or keyword hints.) For unit testing and TDD there is XSpec: https://github.com/xspec/xspec. I'm not sure how easy it is to run XSLT 1.0 in it as the framework uses XSLT 3.0 inside. Should be possible in principle, however. But deciding whether to stick with the old or go with the new is the first choice. The old is tried and true, even if arguably tried and found wanting, whereas the new has also been tried -- ... but YMMV. The easiest quick lift might be to use an XSLT Fiddle and 1.0 to repair your stylesheets first, then use that exercise to base your assessment on going forward. Both what the level of effort is and perhaps how attractive are more up-to-date options (that might be both easier and more useful, longer term) are factors no one else is in a position to assess. Based on what you have shown so far, I'd say your requirements would be fairly straightforward in XSLT 1.0, albeit verbose - and much less code under XSLT 3.0. Just a rough impression though. Good luck - feel free to follow up - Cheers, Wendell From: ohaya ohaya@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Sent: Monday, July 22, 2024 8:24 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Cc: ohaya@xxxxxxxxx Subject: Re: [xsl] Running xsltproc does not produce any output Martin, I just noticed that my subsequent posts were causing a "message too large" response from the mailing list and also the responses were going to my spam folder. FYI, in my replies, I did catch the problem of missing the <syslog> element and was able to make xsltproc "work", but one weird thing was the output was only going to the file I designated in the "-o foo" parameter, and not to stdout. Now that I am past getting xsltproc working, I am trying to determine how I can do what I want to do. Hopefully my first post is readable, because it has all the files, the pta.xsl, the rfc.xsl, and the raw XML that is being processed. Anyway, what I am trying to do is to modify the pta.xsl/rfc.xsl to do is: a) If the XML has "<MessageID>412</MessageID>" and b) If the <ExtraDetails> element has a string "Command=xxxxx$[Tab]yyyyy$;" where the xxxxx$ and yyyyy$ are identical, then b) I need to either remove, or redact/obfuscate the xxxxx$ and yyyyy$ string. In other words, *IF* the <MessageID> value is "412", AND if the <ExtraDetails> element: Contains a string that is like "Command=myPass$[Tab]myPass$;" where the part in front of the "[Tab]" is identical to the part after the "[Tab]", then, I want to change (for example) the <ExtraDetails> from: <ExtraDetails>Command=myPass$[Tab]myPass$;ConnectionComponentId=Users;DstHost =my.solutions;Protocol=NC;ID=Server_W01;SessionID=0...5149;SrcHost=xx.zz.0.24 ;TXTOffset=1593B;User=xxxxx;VIDOffset=39T;</ExtraDetails> To something like: <ExtraDetails>Command=**********$[Tab]*********$;ConnectionComponentId=Users; DstHost=my.solutions;Protocol=NC;ID=Server_W01;SessionID=0...5149;SrcHost=xx. zz.0.24;TXTOffset=1593B;User=xxxxx;VIDOffset=39T;</ExtraDetails> Is that possible to do with XSLT? I am think that it is/may be, but, also I think that maybe I could do something like have the XSLT call out to a small java class/method? Are both of those (pure XSLT approach or use XSLT calling Java) approach possible? (FYI, according to this (https://docs.cyberark.com/Downloads/Legal/Vault%20Third-Party%20Notices.pdf) CyberArk uses Xalan; also FYI, this is on Windows not Linux)? Jim On Sunday, July 21, 2024 at 11:00:41 AM EDT, Martin Honnen martin.honnen@xxxxxx<mailto:martin.honnen@xxxxxx> <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx<mailto:xsl-list-service@xxxxxxxxxxxx rytech.com>> wrote: On 21/07/2024 16:43, ohaya ohaya@xxxxxxxxx<mailto:ohaya@xxxxxxxxx> wrote: I am going to have to modify one of the base XSLTs so I wanted to try xsltproc (on CENTOS) to test/debug, but when I ran a sample XML output using one of the base XSLTs, xsltproc doesn't produce any output (and no errors either), so I was hoping someone might be able to tell me why. The base XSLT references an additional small XSLT via an "xsl:import". Your XSLT seems to look for a syslog root element or at least a container element for the audit_record element but your XML sample has a single audit_record root element. EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/3475705> (by email) XSL-List info and archive<http://www.mulberrytech.com/xsl/xsl-list> EasyUnsubscribe<http://lists.mulberrytech.com/unsub/xsl-list/3302254> (by email<>)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Running xsltproc does not, ohaya ohaya@xxxxxxxx | Thread | Re: [xsl] Running xsltproc does not, ohaya ohaya@xxxxxxxx |
Re: [xsl] Running xsltproc does not, ohaya ohaya@xxxxxxxx | Date | Re: [xsl] Running xsltproc does not, ohaya ohaya@xxxxxxxx |
Month |