Free Support Forum - aspose.com

DOCX LINQ tag parsing


#1

Hi,

How do you parse a docx with LINQ tags to determine the:

  1. List of the well-formed tags located in the docx?
    This would allow us to know the required datesets for generating the report (eg when engine.buildReport(…) is called).

  2. List of malformed (and/or suspicious) LINQ tags within a doc?
    We’d use this as an initial QA step during document creation by content editors.

I was expecting to be able to run something like:

  Document doc = new Document(inDocStrm);
  ReportingEngine engine = new ReportingEngine();
  engine.setOptions(ReportBuildOptions.ALLOW_MISSING_MEMBERS);
  List<Object> fauxDsObjects = Arrays.asList();
  engine.buildReport(doc, fauxDsObjects.toArray());

  // Interrogate document for known tags etc

I’ve been looking at the following APIs, but have been able to locate which (if any) provide information regarding LINQ tags:

BTW - I found an old forum post/request regarding the desire to retrieve the parsed linq nodes. Given you need to identify the nodes, simply providing the set should not be difficult.

Determining the validity of the tags is likely more difficult, but we would be able to perform some validation in addition to yours.

Any guidance would be appreciated.

Cheers,
Erik


#2

@ewestland

Thanks for your inquiry.

Unfortunately, Aspose.Words does not provide API to get the list of well formed tags and list of malformed tags from template document.

Could you please share complete detail of your use case along with your input template document and expected output? We will then provide you more information about your query.

We have linked this forum thread to same feature request (WORDSNET-17454 - Get a list of template fields from a document). You will be notified via this forum thread once this feature is available. We apologize for your inconvenience.