RcBuilder@walla.com
call centre: 054-5614020

SQL FOR XML EXPLICIT

Posted by: RcBuilder  /   Category: DBA / FOR XML / SQL / XML   /   No Comments
09
Nov
2014

SQL FOR XML EXPLICIT SELECT 1 AS 'Tag' ,NULL AS 'Parent' ,NULL AS 'XML!1' ,NULL AS 'Company!2!Code' ,NULL AS 'Company!2!Name' ,NULL AS 'Department!3!Code' ,NULL AS 'Department!3!Name' UNION ALL SELECT 2 AS 'Tag' ,1 AS 'Parent' ,NULL AS 'XML!1' ,RTRIM(Code) AS 'Company!2!Code' ,Name AS 'Company!2!Name' ,NULL AS 'Department!3!Code' ,NULL AS 'Department!3!Name' FROM Company UNION ALL SELECT 3 AS 'Tag' ,2 AS 'Parent' ,NULL AS 'XML!1' ,RTRIM(c.Code) AS 'Company!2!Code' ,NULL AS 'Company!2!Name' ,RTRIM(d.Code) AS 'Department!3!Code' ,d.Name AS 'Department!3!Name' FROM Company c INNER JOIN Department d ON.

Read more

web config custom section group

Posted by: RcBuilder  /   Category: configuration / Custom section / Serialize / XML   /   No Comments
05
Oct
2014

web config custom section group WEB.CONFIG  <configuration> <configSections> <section name="MTGroups" type="ConfigSections.MTGroups" /> </configSections> <MTGroups> <add name="Name1" value="Value1" /> <add name="Name2" value="Value2" /> <add name="Name3" value="Value3" /> </MTGroups> </configuration> SERIALIZATION  using System.Configuration; namespace ConfigSections { public class MTGroups : ConfigurationSection{ public Group keys { get { return (Group)this; } } } public class Group : ConfigurationElementCollection{ protected override ConfigurationElement CreateNewElement() { return new Key(); } protected override object GetElementKey(ConfigurationElement element) { return ((Key)element).name; } } public class Key : ConfigurationElement{ public string name { get {.

Read more

custom config section example

Posted by: RcBuilder  /   Category: configuration / Custom section / IEnumerable / Serialize / XML   /   No Comments
01
Oct
2014

custom config section example namespace ConfigSections // this class should define the xml structure of your custom config section in order to get the // ability to deSerialize it public class MTGroups : ConfigurationSection, IEnumerable<MTGroups.Key> { public MTGroups.Group keys { get { return (MTGroups.Group)this; } } public IEnumerator<MTGroups.Key> GetEnumerator() { foreach (MTGroups.Key k in this.keys) yield return k; } IEnumerator IEnumerable.GetEnumerator() { throw new NotImplementedException(); } public class Group : ConfigurationElementCollection { protected.

Read more

xslt with c-sharp script

Posted by: RcBuilder  /   Category: CSS / XML / XSLT   /   No Comments
29
Sep
2014

xslt with c-sharp script <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:XSLTHelper="dummy"> // add dummy namespace <xsl:output method="xml" indent="yes" /> <msxsl:script language="C#" implements-prefix="XSLTHelper"> // add c# script <!]> </msxsl:script> <xsl:variable name="templateRoot">Templates/Liderforex/cn/</xsl:variable> <xsl:template match="Root/NewsItems"> <xsl:for-each select="Item"> <div class="MarketNewsWrapper"> <div class="MarketNewsPhoto"> <img src="{$templateRoot}images/MarketNews/{XSLTHelper:Remove(Category/., ' ')}.jpg" alt="{Category/.}" /> // call c# method </div> <div class="MarketNewsContent"> <div class="MarketNewsTitle"> <xsl:value-of select="Title/." /> </div> <div class="MarketNewsDate"> <xsl:value-of select="NewsDate/." /> </div> <div class="MarketNewsBody"> <xsl:value-of select="Body/." disable-output-escaping="yes" /> </div> </div> <div class="Clear"></div> </div> <div.

Read more

custom email Config Section

Posted by: RcBuilder  /   Category: configuration / XML   /   No Comments
22
Sep
2014

custom Config Section -  email .config: <?xml version="1.0"?> <configuration> <configSections> <section name="MailSection" type="ConfigSections.MailSection, WebMonitoring"/> </configSections> <MailSection> <From>info@domain.com</From> <To>Roby@domain.com</To> <Bcc>Roby@domain.com</Bcc> <DisplayName>Roby</DisplayName> <PORT>25</PORT> <SMTP>smtp.domain.com</SMTP> <UserName>userName</UserName> <UserPass>password</UserPass> <Encoding>utf-8</Encoding> </MailSection> </configuration> ConfigSections.cs: namespace ConfigSections { public class Element : ConfigurationElement { public string value { get; private set; } protected override void DeserializeElement(System.Xml.XmlReader reader, bool serializeCollectionKey) { this.value = reader.ReadElementContentAs(typeof(string), null) as string; } } public class MailSection : ConfigurationSection { public Element From { get { return (Element)this; } } public Element To { get { return (Element)this; } } public Element Bcc.

Read more

string extension ToXML

Posted by: RcBuilder  /   Category: Extensions / SOURCE CODE / XML   /   No Comments
24
Jun
2014

string extension - ToXML public static class Extension { public static XDocument ToXML(this string me) { try { return XDocument.Parse(me); } catch(Exception ex) { return new XDocument(new XElement("ERROR", ex.Message)); } } } USING var XML =.

Read more

Adwords scripts XML Using Examples

Posted by: RcBuilder  /   Category: Adwords Scripts / JAVASCRIPT / SEM / SOURCE CODE / XML / XML DOCUMENT   /   No Comments
06
Jun
2014

Adwords scripts XML Using Examples // add elements from array of data var xml = '<root></root>'; var document = XmlService.parse(xml); var root = document.getRootElement(); var arr = ; root.setAttribute('total', arr.length); for(i in arr) root.addContent(XmlService.createElement('value').setText(arr)); var formatted_xml = XmlService.getPrettyFormat().format(document); Logger.log(formatted_xml); - result -- <?xml version="1.0" encoding="UTF-8"?> <root.

Read more

Adwords scripts XML Using Examples

Posted by: RcBuilder  /   Category: Adwords Scripts / JAVASCRIPT / SEM / SOURCE CODE / XML / XML DOCUMENT   /   No Comments
06
Jun
2014

Adwords scripts XML Using Examples // create xml document with cdata, text and elements var cdata = XmlService.createCdata('<span style="font-weight:bold;color:red;">HELLO WORLD</span>'); var text = XmlService.createText('HELLO WORLD'); var root = XmlService.createElement('root'); var elem1 = XmlService.createElement('elem1').setText('HELLO WORLD'); var elem2 = XmlService.createElement('elem2').addContent(text); var elem3 = XmlService.createElement('elem3').addContent(cdata); root.addContent(elem1).addContent(elem2).addContent(elem3); var document = XmlService.createDocument(root); var formatted_xml = XmlService.getPrettyFormat().format(document); Logger.log(formatted_xml); - result -- <?xml version="1.0" encoding="UTF-8"?> <root> <elem1>HELLO WORLD</elem1> <elem2>HELLO.

Read more

Adwords scripts XML Using Examples

Posted by: RcBuilder  /   Category: Adwords Scripts / JAVASCRIPT / SEM / SOURCE CODE / XML / XML DOCUMENT   /   No Comments
06
Jun
2014

Adwords scripts XML Using Examples // create an xml document, read and write attributes from and to it var xml = '<users> <user firstName="Roby" lastName="Cohen" /> <user firstName="Avi" lastName="Cohen" /> <user firstName="Shirly" lastName="Massa" /> </users>'; var document = XmlService.parse(xml); var users = document.getRootElement().getChildren('user'); for (var i = 0; i < users.length; i++) { var user = users; var firstName = user.getAttribute('firstName').getValue(); var lastName = user.getAttribute('lastName').getValue(); user.setAttribute('fullName', firstName +.

Read more

Adwords scripts XML Using Examples

Posted by: RcBuilder  /   Category: Adwords Scripts / JAVASCRIPT / SEM / SOURCE CODE / XML / XML DOCUMENT   /   1 Comment
06
Jun
2014

Adwords scripts XML Using Examples // create xml document from string and format it in several ways var xml = '<root><a><b>Text!</b><b>More text!</b></a></root>'; var document = XmlService.parse(xml); var output1 = XmlService.getCompactFormat().format(document); var output2 = XmlService.getRawFormat().format(document); var output3 = XmlService.getPrettyFormat().format(document); var output4 = XmlService.getCompactFormat().setLineSeparator('\n').setEncoding('UTF-8').setIndent(' ').format(document); // explicit Logger.log(output1); Logger.log(output2); Logger.log(output3); Logger.log(output4); - result - <?xml version="1.0" encoding="UTF-8"?> <root><a><b>Text!</b><b>More text!</b></a></root> <?xml version="1.0" encoding="UTF-8"?> <root><a><b>Text!</b><b>More text!</b></a></root> <?xml version="1.0" encoding="UTF-8"?> <root> <a> <b>Text!</b> <b>More text!</b> </a> </root> <?xml version="1.0" encoding="UTF-8"?> <root> <a> <b>Text!</b> <b>More.

Read more
  • פיתוח מערכות
  • פתרונות טכנולוגים
  • קידום אתרים
  • בניית אתרים