-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdelete.xsl
More file actions
45 lines (38 loc) · 1.65 KB
/
delete.xsl
File metadata and controls
45 lines (38 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?xml version="1.0" encoding="UTF-8"?>
<?modxslt-stylesheet type="text/xsl" media="fuffa, screen and $GET[stylesheet]" href="./%24GET%5Bstylesheet%5D" alternate="no" title="Translation using provided stylesheet" charset="ISO-8859-1" ?>
<?modxslt-stylesheet type="text/xsl" media="screen" alternate="no" title="Show raw source of the XML file" charset="ISO-8859-1" ?>
<!-- Generating MEX access layer code from Data Dictionary IDSDef.xml -->
<!-- -->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
xmlns:my="dummy"
version="2.0">
<xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>
<!--=================================================-->
<!-- delete IDS entry in database -->
<!--=================================================-->
<xsl:template match="field" mode="DELETE">
<xsl:call-template name="COMMENT_FIELD"/>
<xsl:choose>
<xsl:when test="@data_type='structure'">
status = delete_<xsl:value-of select="concat(@name,'_',generate-id(.))"/>(ctx);
/* Error handling */
if (status.code < 0) {
addIdsPathInfoToErrMsg("\n ... in structure <xsl:value-of select="@path"/>",0);
return status;
}
</xsl:when>
<xsl:otherwise>
fieldPath = "<xsl:value-of select="@path"/>";
status = al_delete_data(ctx, fieldPath);
/* Error handling */
if (status.code < 0) {
addIdsPathInfoToErrMsg("\n ... in field <xsl:value-of select="@path"/>",0);
return status;
}
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>