/ Published in: C#
URL: http://reboltutorial.com/blog/parsing-optional-html-tag-attributes-using-none-keyword/
Expand |
Embed | Plain Text
content: {<tag attribute1="valueattribute1" attribute2="valueattribute2"> </tag> <tag attribute2="valueattribute21" attribute1="valueattribute11" > </tag> } content: {<tag attribute1="valueattribute1" attribute2="valueattribute2"> </tag> <tag> </tag> } content: {<tag attribute1="valueattribute1" attribute2="valueattribute2"> </tag> <tag attribute2="valueattribute21"> </tag> } {<tag } {attribute1="} valueattribute1 {"} {attribute2="} valueattribute2 {"} {>} Bla ... {</tag>} attribute1: [{attribute1="} copy valueattribute1 to {"} thru {"} ] attribute2: [{attribute2="} copy valueattribute2 to {"} thru {"}] rule: [any [to {<tag } thru {<tag } [attribute1 attribute2 (print valueattribute1 print valueattribute2) | attribute2 attribute1 (print valueattribute2 print valueattribute1) ] {>} to {</tag>} thru {</tag>} ] to end] attributes-rule: [attribute1 attribute2 (print valueattribute1 print valueattribute2 ) | attribute2 attribute1(print valueattribute2 print valueattribute1) | none ] rule: [any [to {<tag } thru {<tag } attributes-rule {>} to {</tag>} thru {</tag>}] to end] attributes-rule: [[attribute1 | none] [attribute2 | none] (print valueattribute1 print valueattribute2) | attribute2 attribute1(print valueattribute2 print valueattribute1) | none ] rule: [any [to {<tag } thru {<tag } attributes-rule {>} to {</tag>} thru {</tag>}] to end] attributes-rule: [[attribute1 | none] [attribute2 | none] (print valueattribute1 print valueattribute2 valueattribute1: none valueattribute2: none) | attribute2 attribute1(print valueattribute2 print valueattribute1 valueattribute1: none valueattribute2: none ) | none ] rule: [any [to {<tag } thru {<tag } attributes-rule {>} to {</tag>} thru {</tag>}] to end]
You need to login to post a comment.
