XML mapping - XSLT or code?

I recently had some discussions about whether to use XSLT or code to write mapping functions from one XML format to another, or even when converting to something other than XML. Now I am configured that the purpose of XSLT for this type of thing will be the most suitable option.

However, other people suggest that this is not suitable if you need something more complex, for example, when you need to start searching for data from external repositories. They also suggested that XSLT could be as complex as writing code, so this negates this argument. And testing will be easier with a code solution using the TDD and CI methods.

The basis for this discussion is the development of a common transformation service that should be used by WCF services when any mapping is required. For example, when converting an incoming message to canonical form. I thought it would be better to write this service in order to map the XML message to the XSLT map. Then you can easily insert / remove these cards without recompiling the code, and get much easier on these cards and understand what happens outside the code.

I was wondering what you guys thought, and does anyone have experience writing something like that? I know that I can go buy a product, but I’d rather hear about custom solutions.

thank

+3
source share
4

XSLT; .

. XML ; , . ( , / , ​​XML-, document, .)

, XML-, , , .

XML- , XSLT . , XML , - XML-, XML, . , -, , MM/DD/YYYY booleans Y N. XSLT, , , , , XSLT.

+1

-, , XSLT - .;) , .

XML, XSLT; . - - ( XSLT ). , , , XSLT - ( - /).

, , XSLT- . , XSLT (.. Project/Company Time), / . (;) .

XSLT ; , .

+4

, , XSLT XML-. XSLT, TextMate TeXSLMate -.

, XSLT , , - , - - .

+3

- XSLT XML , , .

, - , ... , XSL , . XSLT .

One of the problems with XSLT vs Code is that with XSLT you need whole XML and XSL files in memory to convert, so if you have large files (hunderds megs and higher), this may not be the best way.

+2
source

Source: https://habr.com/ru/post/1725826/


All Articles