Click here to Skip to main content
15,912,897 members

Ilka Guigova - Professional Profile



Summary

    Blog RSS
3,733
Author
60
Authority
328
Debator
193
Editor
5
Enquirer
346
Organiser
888
Participant

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
GeneralOne-liners Pin
Ilka Guigova4-Jun-12 7:34
Ilka Guigova4-Jun-12 7:34 
GeneralLogical XOR in Javascript Pin
Ilka Guigova25-Apr-11 14:36
Ilka Guigova25-Apr-11 14:36 
GeneralA Collapsible Outline of Indented Text in Javascript Pin
Ilka Guigova6-Feb-11 16:19
Ilka Guigova6-Feb-11 16:19 
GeneralPython calculations - arrangements Pin
Ilka Guigova30-Aug-10 7:44
Ilka Guigova30-Aug-10 7:44 
GeneralVisualStudio 2005 Slow On Save Pin
Ilka Guigova23-May-10 13:44
Ilka Guigova23-May-10 13:44 
GeneralT-SQL Cursor and XML Basic Example Pin
Ilka Guigova3-Apr-10 13:13
Ilka Guigova3-Apr-10 13:13 
GeneralT-SQL Auto Increment Variable Pin
Ilka Guigova2-Apr-10 20:04
Ilka Guigova2-Apr-10 20:04 
GeneralApplying XSL Transformations Pin
Ilka Guigova29-Mar-10 11:05
Ilka Guigova29-Mar-10 11:05 
Setup:
A data from one module is passed into another so that Module 1 takes a (flat) file as input and feeds an xml structure into Module 2. While Module 2 is internal, Module 1 is designed to handle different customer inputs into the system. However, it is not always possible to generate the expected Module 2 xml structure from the flat file in one step.

|Customer| -> file -> |Module 1| -> xml(products-product-detail) -> |Module 2|

There are at least two ways to accomodate the (multi-step) translation process:
  • Add re-parsing logic directly in the code - not smart enough as we do not know what input formats will need to be supported by Module 1 in the future
  • Apply customizable xsl transformations - providing decoupled solution with a reliable techology


For example:

Given a list of details, we can group them into product(s) in order to conform to the expected Module 2 hierarchy.

List of details:
XML
<?xml version='1.0' encoding="iso-8859-1"?>
<PRODUCTS>
	<DETAIL>
		<DESC>D1</DESC>
		<PRODUCT_NAME>APL</PRODUCT_NAME>
	</DETAIL>
	<DETAIL>	
		<DESC>D2</DESC>
		<PRODUCT_NAME>ANL</PRODUCT_NAME>
	</DETAIL>
	<DETAIL>
		<DESC>D3</DESC>
		<PRODUCT_NAME>APL</PRODUCT_NAME>
	</DETAIL>
</PRODUCTS> 


List of details grouped by product:
XML
<?xml version='1.0' encoding="iso-8859-1"?>
<PRODUCTS>
	<PRODUCT>
		<PRODUCT_NAME>ANL</PRODUCT_NAME>
		<DETAIL>	
			<DESC>D2</DESC>
			<PRODUCT_NAME>ANL</PRODUCT_NAME>
		</DETAIL>
	</PRODUCT>
	<PRODUCT>
		<PRODUCT_NAME>APL</PRODUCT_NAME>
		<DETAIL>
			<DESC>D1</DESC>
			<PRODUCT_NAME>APL</PRODUCT_NAME>
		</DETAIL>
		<DETAIL>
			<DESC>D3</DESC>
			<PRODUCT_NAME>APL</PRODUCT_NAME>
		</DETAIL>
	</PRODUCT>
</PRODUCTS> 


Thumbs Up | :thumbsup: In order to achieve this grouping, we can use the Muenchian method as described here:

http://www.jenitennison.com/xslt/grouping/muenchian.html[^]
XML
<!-- GROUPING USING THE MUENCHIAN METHOD: http://www.jenitennison.com/xslt/grouping/muenchian.html -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" indent="yes" encoding="iso-8859-1"/>

	<xsl:key name="details-by-product" match="DETAIL" use="PRODUCT_NAME" />

	<xsl:template match="PRODUCTS">
		<PRODUCTS>
		<xsl:for-each select="DETAIL[count(. | key('details-by-product', PRODUCT_NAME)[1]) = 1]">
			<xsl:sort select="PRODUCT_NAME" />
			<PRODUCT>
				<PRODUCT_NAME><xsl:value-of select="PRODUCT_NAME"/></PRODUCT_NAME>
				<xsl:for-each select="key('details-by-product', PRODUCT_NAME)">
					<DETAIL>
					<xsl:apply-templates/>
					</DETAIL>
				</xsl:for-each>
			</PRODUCT>
		</xsl:for-each>
		</PRODUCTS>
	</xsl:template>

	<xsl:template match="@*|node()">
	  <xsl:copy>
		<xsl:apply-templates select="@*|node()"/>
	  </xsl:copy>
	</xsl:template>
</xsl:stylesheet>

See also:

    XSL Transformations (XSLT):  http://www.w3.org/TR/xslt[^]
    Grouping With XSLT 2.0:  http://www.xml.com/pub/a/2003/11/05/tr.html[^]
    Dave Pawson's Grouping page:  http://www.dpawson.co.uk/xsl/sect2/N4486.html[^]


Thumbs Up | :thumbsup: In order to test the transformation, we can initiate the xslt in a script as described here:

http://msdn.microsoft.com/en-us/library/ms762796(VS.85).aspx[^]
//Initiate XSLT in a script: http://msdn.microsoft.com/en-us/library/ms762796(VS.85).aspx
var oArgs = WScript.Arguments;

if (oArgs.length == 0)
{
    WScript.Echo ("Usage : cscript xslt.js xml xsl");
    WScript.Quit();
}
xmlFile = oArgs(0) + ".xml";
xslFile = oArgs(1) + ".xsl";

var xsl = new ActiveXObject("MSXML2.DOMDOCUMENT.6.0");
var xml = new ActiveXObject("MSXML2.DOMDocument.6.0");
xml.validateOnParse = false;
xml.async = false;
xml.load(xmlFile);

if (xml.parseError.errorCode != 0)
    WScript.Echo ("XML Parse Error : " + xml.parseError.reason);

xsl.async = false;
xsl.load(xslFile);

if (xsl.parseError.errorCode != 0)
    WScript.Echo ("XSL Parse Error : " + xsl.parseError.reason);

try
{
    WScript.Echo (xml.transformNode(xsl.documentElement));
}
catch(err)
{
    WScript.Echo ("Transformation Error : " + err.number + "*" + err.description);
}


Thumbs Up | :thumbsup: In order to apply the transformation at run-time, we can use the XslCompiledTransform as described here:

http://msdn.microsoft.com/en-us/library/system.xml.xsl.xslcompiledtransform_members.aspx[^]
C#
// XslCompiledTransform: http://msdn.microsoft.com/en-us/library/system.xml.xsl.xslcompiledtransform_members.aspx
// Note: Exception handling is outside of the scope of this tip
// Note: Xml results are loaded into memory and do not have to be written into the file system, if there is no need for it.
private string ApplyStylesheet(string xml, string stylesheet)
{
	if (!string.IsNullOrEmpty(stylesheet))
	{
		//Configure the reader to skip all forms of validation
		XmlReaderSettings settingsReader = new XmlReaderSettings();
		settingsReader.ValidationType = ValidationType.None;
		settingsReader.ProhibitDtd = false;
		settingsReader.XmlResolver = null;

		StringReader strReader = new StringReader(xml);
		XmlReader xmlReader = XmlReader.Create(strReader, settingsReader);
		// use XmlNodeReader xmlReader = new XmlNodeReader(xml); if xml is XmlNode (not a string)

		StringWriter stringWriter = new StringWriter();
		XmlTextWriter xmlWriter = new XmlTextWriter(stringWriter);

		XslCompiledTransform xslt = new XslCompiledTransform();
		xslt.Load(stylesheet);
		xslt.Transform(xmlReader, xmlWriter);

		xmlWriter.Close();
		xmlReader.Close();

		return stringWriter.ToString();
	}
	return xml;
}


Good luck!
GeneralXML DOM Load Functions Pin
Ilka Guigova10-Aug-12 13:46
Ilka Guigova10-Aug-12 13:46 
GeneralWorking with durations in MSSQL server Pin
Ilka Guigova31-Jan-10 13:11
Ilka Guigova31-Jan-10 13:11 
GeneralRe: Working with durations in MSSQL server Pin
Grunge Boy31-Jan-10 23:29
Grunge Boy31-Jan-10 23:29 
GeneralRe: Working with durations in MSSQL server Pin
Ilka Guigova1-Feb-10 7:17
Ilka Guigova1-Feb-10 7:17 
GeneralThe hidden __arglist keyword Pin
Ilka Guigova9-Aug-09 14:38
Ilka Guigova9-Aug-09 14:38 
GeneralServices Pin
Ilka Guigova9-Aug-09 14:27
Ilka Guigova9-Aug-09 14:27 
GeneralTerminal Services Pin
Ilka Guigova9-Aug-09 14:24
Ilka Guigova9-Aug-09 14:24 
GeneralSerial com ports Pin
Ilka Guigova9-Aug-09 14:18
Ilka Guigova9-Aug-09 14:18 
GeneralScrollable GridView Pin
Ilka Guigova9-Aug-09 13:58
Ilka Guigova9-Aug-09 13:58 
GeneralHow to instantiate a class from a class name Pin
Ilka Guigova9-Aug-09 11:08
Ilka Guigova9-Aug-09 11:08 
GeneralDebugging COM+ Components in Visual Studio Pin
Ilka Guigova9-Aug-09 10:41
Ilka Guigova9-Aug-09 10:41 
GeneralRetrieving the COM+ class factory for component failed Pin
Ilka Guigova29-Jul-10 12:10
Ilka Guigova29-Jul-10 12:10 
GeneralDebugging COM+ Components in Delphi Pin
Ilka Guigova9-Aug-09 9:27
Ilka Guigova9-Aug-09 9:27 
GeneralCOM Surrogate error Pin
Ilka Guigova9-Aug-09 9:07
Ilka Guigova9-Aug-09 9:07 
GeneralC++ conversion - text to currency Pin
Ilka Guigova9-Aug-09 8:54
Ilka Guigova9-Aug-09 8:54 
GeneralApplication.ProcessMessages() without the Forms unit Pin
Ilka Guigova9-Aug-09 8:38
Ilka Guigova9-Aug-09 8:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.