skip to Main Content

Visual Studio Code – How to conditionally transform XAML at build time using XSLT to mirror C# preprocessor directives?

I use C# preprocessor directives extensively while developing. I define them either directly in .cs files or globally in the .csproj: <PropertyGroup> <DefineConstants>fix_issue_001;fix_issue_002;</DefineConstants> </PropertyGroup> Or via command line as described here. Then I use them to compartmentalize code: #if fix_issue_001…

VIEW QUESTION

XSLT replacing Json with plain text equivelent

ish at XSLT and have a XSLT output that contains some json within elements. I've been looking around to see if there is anyway for XSLT to replace the json with just a string: Ex: <company:Cause xmlns:company="http://example.com/company" xmlns:j="http://example.com/j" xmlns:s="http://example.com/s" xmlns:nc="http://example.com/nc"…

VIEW QUESTION

How to get the value of a XML node which has a specific attribute value using JavaScript?

I have this XML file (stripped down): <?xml version="1.0" encoding="UTF-8"?> <Labels Version="24100002"> <Attendant>Attendant</Attendant> <Attendant Index="1">Car Park Attendant</Attendant> <Attendant Index="2">Entrance Attendant</Attendant> <Attendant Index="3">Auditorium Attendant</Attendant> <Attendant Index="4">Attendant 4</Attendant> </Labels> And, I have this JavaScript for loading a file: function loadXMLDoc(filename) { return…

VIEW QUESTION

XSLT3 set json output to array of string without key

I am new to xslt, I have a xml containing those elements <cbl:ShippingAddress> <cbl:AddressLine AddressLineNumber="1"> <cbl:Line>line1</cbl:Line> </cbl:AddressLine> <cbl:AddressLine AddressLineNumber="2"> <cbl:Line>line2</cbl:Line> </cbl:AddressLine> </cbl:ShippingAddress> using this code <map key="address"> <array key="lines"> <xsl:for-each select="/cbl:ShippingAddress/cbl:AddressLine/cbl:Line"> <map> <string key="line">{.}</string> </map> </xsl:for-each> </array> </map> I get…

VIEW QUESTION

Converting XML Records to JSON Using XSLT Transformation – Issue with Number Formatting

I'm working on a project where I fetch data from a database using a stored procedure. The data is returned in XML format like this: <record> <field name="ID">8f7e-25fbcce2cdc7</field> <field name="TRANSACTIONSTATUS">202</field> <field name="TRANSAMT">1.90</field> <field name="SNDNAME">MR. Jade</field> <field name="RECVNAME">MR. Lucas</field> <field name="SNDACCTNUMBER">8224002623</field>…

VIEW QUESTION
Back To Top
Search