Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Tutorials
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • DataMiner Insights
      • Security
      • Integration Studio
      • System Architecture
      • DataMiner Releases & Updates
      • DataMiner Apps
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

How to display raw XML string in LCA component

Solved972 views15th April 2024grid component item template LCA string formatting
1
Jonas Kockx [SLC] [DevOps Enabler]203 15th April 2024 0 Comments

Hi

I noticed when trying to display a XML string in a grid component in LCA, that it is not displayed as the raw string.

E.g.:

New2604776177644032024/04/18 15:30:002024/04/18 16:00:002024/04/18 19:00:004a27bd2c-c010-409f-940b-3f512465c65d3 JPEG 2Kj2k150-PPNFL Atlanta Falcons vs. New Orleans SaintsSkyline Communications12906721280485150.5281MercedesBenzStadiumATLNFLMCRNY2024/04/13 05:10:12

Instead of:

<NMSHost><CircuitSetup><MessageType>New</MessageType><CircuitID>2604776</CircuitID><SharedID>17764403</SharedID><tLead>2024/04/18 15:30:00</tLead><tStart>2024/04/18 16:00:00</tStart><tEnd>2024/04/18 19:00:00</tEnd><ServiceType>4a27bd2c-c010-409f-940b-3f512465c65d</ServiceType><ServiceDescription>3 JPEG 2K</ServiceDescription><ServiceID>j2k150-PP</ServiceID><JobName>NFL Atlanta Falcons vs. New Orleans Saints</JobName><Client>Skyline Communications</Client><SequenceNumber>1290672</SequenceNumber><WorkOrder>1280485</WorkOrder><Capacity>150.528</Capacity><ProtectionID>1</ProtectionID><Source>MercedesBenzStadiumATL</Source><Path><Node>dtm11:1_LA-688-2</Node><Node>dtm2:8_LANim9</Node><Node>dtm6:1_TOR-688-1</Node><Node>dtm1:4_NYNim11</Node></Path><Destination>NFLMCRNY</Destination><TimeStamp>2024/04/15 08:23:42</TimeStamp></CircuitSetup></NMSHost>

How can I display the raw string in my grid component? (my string is a field of a DOM instance)

Jonas Kockx [SLC] [DevOps Enabler] Answered question 15th April 2024

3 Answers

  • Active
  • Voted
  • Newest
  • Oldest
0
Edib Šupić [SLC] [DevOps Catalyst]2.05K Posted 15th April 2024 2 Comments

Hi Jonas,

Can you try replacing '<' with "&lt;", '>' with "&gt;" and '&' with "&amp;"? You may also want to wrap entire string in <pre> tag to maintain the formatting.

Let me know if this helps,
Cheers

Edib Šupić [SLC] [DevOps Catalyst] Edited comment 15th April 2024
Jonas Kockx [SLC] [DevOps Enabler] commented 15th April 2024

Encoding my string by replacing the helped. I’ve created a custom GQI operator which encodes that column for me. Thanks! (the tag didn’t seem to do the job at first sight)

Edib Šupić [SLC] [DevOps Catalyst] commented 15th April 2024

I’m happy to hear that. Did you encode < and > in the <pre> tag? If you did, can you try without encoding them just for the tag, in this case we want <pre> to be interpreted as an HTML tag.

2
Jonas Kockx [SLC] [DevOps Enabler]203 Posted 15th April 2024 0 Comments

Based on the answers above I used this custom GQI operator to encode the column in my table (or a duplicated column). It uses HtmlEncode from System.Web

Note: make sure to set the following in your script XML:

<Param type="preCompile">true</Param>

<Param type="libraryName">HTMLEncode</Param>

GQI operator
using Skyline.DataMiner.Analytics.GenericInterface;
using System.Web;

[GQIMetaData(Name = "HTML Encode")] public class HTMLEncodeOperator : IGQIRowOperator, IGQIInputArguments
{
private GQIColumnDropdownArgument _htmlColumnArg = new GQIColumnDropdownArgument("Column") { IsRequired = true, Types = new GQIColumnType[] { GQIColumnType.String } };

private GQIColumn _htmlColumn;

public GQIArgument[] GetInputArguments()
{
return new GQIArgument[] { _htmlColumnArg };
}

public OnArgumentsProcessedOutputArgs OnArgumentsProcessed(OnArgumentsProcessedInputArgs args)
{
_htmlColumn = args.GetArgumentValue(_htmlColumnArg);
return new OnArgumentsProcessedOutputArgs();
}

public void HandleRow(GQIEditableRow row)
{
string html;
if (!row.TryGetValue(_htmlColumn, out html))
return;
var encoded = HttpUtility.HtmlEncode(html);
row.SetValue(_htmlColumn, encoded, encoded);
}
}

Jonas Kockx [SLC] [DevOps Enabler] Answered question 15th April 2024
2
Seppe Dejonckheere [SLC] [DevOps Advocate]2.21K Posted 15th April 2024 1 Comment

Hi Jonas,

The grid component allows some html tags for markup purposes. It seems to me like the xml tags are being interpreted as html tags here, so they don't show up as raw text (and they probably don't show up in the DOM either, since those aren't valid html tags).

In order to show the raw xml string, you probably will have to html encode the string.

Jonas Kockx [SLC] [DevOps Enabler] Posted new comment 15th April 2024
Jonas Kockx [SLC] [DevOps Enabler] commented 15th April 2024

That was exactly the problem. I wrote a custom operator encoding my column by replacing some characters in my string as suggested in another answer. Thanks!

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas

Recent questions

Alarm Dashboard PDF/CSV Export 0 Answers | 0 Votes
Is the Microsoft SharePoint Connector Still Usable 0 Answers | 0 Votes
Is the Microsoft SharePoint Connector Still Usable 0 Answers | 0 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (108) Correlation (68) Cube (150) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (139) driver (65) DVE (55) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (151) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) services (51) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin