Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Prashanth Chandra

Ranch Hand
+ Follow
since Dec 07, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Prashanth Chandra

Error messages are not being generated in jboss server.log This makes troubleshooting very hard. We are getting authentication error messages in the jboss server logs. It works by putting the below tag:

Add the following category the file.
<code>

<category name="com.tricubes">
<priority value="INFO" />
<appender-ref ref="FILE"/>
<appender-ref ref="CONSOLE"/>
</category>

</code>

In addition, the jboss-log4j.xml file must be touched once the jboss server is started up for logging to be enabled. I want such that we should not do a touch for the jboss-log4j.xml and also how can I get this tag by default in .xml file.
8 years ago
I have not copied the whole XML file as it is a very huge one. There is also an attribute for BasicAttributes in the XML and it is working fine when i am retrieving the values for it. I am not able to get the data for Over All Depth attribute.
I have the below XML and I need to read the attribute "Overall Depth" from the XML file through an XSL file. I am not able to read the value in the XSL file for the condition check

<?xml version="1.0" encoding="UTF-8"?>
<Products xmlns:appliance="http://www.nonamespace/appliance" DateGenerated="06-02-2009 T08:12:21">
<Product ModelNumber="A3316ABSBB">
<DataSource Name="XCAT">
<AttributeGroups>
<AttributeGroup Name="WEIGHTS & DIMENSIONS">
<Attribute Name="Approximate Shipping Weight">163</Attribute>
<Attribute Name="Net Weight (lbs.)">144</Attribute>
<Attribute Name="Overall Height">61.75</Attribute>
<Attribute Name="Overall Width">28</Attribute>
<Attribute Name="Overall Depth">29.125</Attribute>
<Attribute Name="Case Depth Without Door (in.)">25-7/8</Attribute>
<Attribute Name="Depth with Door Open 90° (in.)">54-7/8</Attribute>
<Attribute Name="Depth Without Handle (in.)">29-1/8</Attribute>
<Attribute Name="Height to Mid-Freezer">51-3/8</Attribute>
<Attribute Name="Height to Top of Case (in.)">61-1/4</Attribute>
<Attribute Name="Width w/Door Open 90 Degrees Incl. Handle (in.)">30-1/2</Attribute>
<Attribute Name="Width w/Door Open 90 Degrees Less Handle (in.)">28-5/8</Attribute>
<Attribute Name="Back Air Clearances (in.)">1</Attribute>
<Attribute Name="Side Air Clearances (in.)">3/4</Attribute>
<Attribute Name="Top Air Clearances (in.)">1</Attribute>
</AttributeGroup>
</AttributeGroups>
</DataSource>
</Product>
</Products>


Below is my XSL file:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xslt"
xmlns:dyn="http://exslt.org/dynamic"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:common="http://exslt.org/common"
xmlns:fn="http://functions"
xmlns:redirect="http://xml.apache.org/xalan/redirect"
extension-element-prefixes="xalan redirect fn dyn date"
version="1.0">

<xsl:import href="common-functions.xsl"/>
<xsl:variable name="mapping-file" select="'mapping/uccnet-mapping.xml'"/>
<xsl:variable name="attribute-mapping" select="document($mapping-file)/AttributeMappings" />


<xsl:variable name="model-file" select="'../trigger/inputxml/trigger.xml'"/>
<xsl:variable name="model-mapping" select="document($model-file)/Trigger/Products" />


<xsl:param name="delimiter" select="','"/>
<xsl:variable name = "marketGln">,marketGLN,publicationType</xsl:variable>

<xsl:param name="delivery-report-file"/>
<xsl:param name = "market_gln" />
<xsl:strip-space elements="*" />
<xsl:output method="text"/>

<xsl:template match="/Products">
<xsl:variable name="filter-by-valid-sku"
select="Product[DataSource[@Name='XCAT']/BasicAttributes[Attribute[@Name='RELEASEDATE']!='' and
Attribute[@Name='DESCRIPTION']!='' and Attribute[@Name='UDEXCODE']!='']]"/>
<xsl:call-template name = "print-header"/>
<!-- Print Content -->
<xsl:for-each select = "$filter-by-valid-sku">

<xsl:variable name = "ModelNumber" select="$model-mapping/Product/SKU" />
<xsl:if test="@ModelNumber =$ModelNumber">
<xsl:if test="Product[DataSource[@Name='XCAT']/AttributeGroups/AttributeGroup[@Name='WEIGHTS & DIMENSIONS']/Attribute[@Name='Overall Depth']] !=''">

<xsl:call-template name="print-content">
<xsl:with-param name="aggr-sku-data" select="." />
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- Print Content -->
<xsl:template name = "print-header">
<xsl:for-each select="$attribute-mapping/Mapping">
<xsl:value-of select="normalize-space(@Name)"/>
<xsl:choose>
<xsl:when test = "position()!=last()">
<xsl:value-of select="$delimiter" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$marketGln" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text> </xsl:text>
</xsl:template>

<xsl:template name= "print-content">
<xsl:param name="aggr-sku-data" />
<xsl:for-each select="$attribute-mapping/Mapping">
<xsl:variable name="attribute-value">
<xsl:choose>

<xsl:when test="@source='hardcode'">
<xsl:value-of select="text()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="dyn:evaluate(text())"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test ="$attribute-value!=''">
<xsl:value-of select="normalize-space($attribute-value)"/>
</xsl:if>
<xsl:choose>
<xsl:when test = "position()!=last()">
<xsl:value-of select="$delimiter" />
</xsl:when>
<xsl:otherwise>
<xsl:text>,</xsl:text>
<xsl:value-of select="$market_gln"/>
<xsl:value-of select="$delimiter" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:text> </xsl:text>
</xsl:template>
</xsl:stylesheet>

But I am not able to read the value in the XSL file for the condition check.

Thanks in advance
regards
Prashanth
Hi,
I have tried the above options but these does not seem to solve my problem,can someone help me in understading where exactly the issue is/which jar file is creating this issue. I have a lot of jar files in my application because of which I am not able to understand which jar version is going wrong. I have tried with the below jars by downloading the latest one which did not sovle by problem.

xercesImpl.jar
jaxp.jar
xml-apis.jar

regards
Prashanth
12 years ago
Hi
My class is using the following class: java.lang.reflect.Method. Its not importing/implementing any other classes.



regards
Prashanth
12 years ago
Hi,
I am getting the following error when I am trying to excute the below code. I am not able to understand what is causing the below error, I felt its a jar file problem but not able to find the exact jar file.


public static Object invokeMethod(Object p_object,String p_method,Object p_value)
throws Exception {
Method l_method = null;
Object[] l_params = null;
Class[] l_paramTypes = null;
Object l_resultObject = null;
GEALogger.dbg(_moduleName,"invoking method "+p_method+" on "+p_object.getClass().toString());
try {
if(p_value != null){
l_paramTypes = new Class[] { p_value.getClass() };
l_params = new Object[] { p_value };
}
l_method = p_object.getClass().getMethod(p_method,l_paramTypes);
l_resultObject = l_method.invoke(p_object,l_params);
}catch(Exception p_excep){
GEALogger.dbg(_moduleName,"Method "+p_method+" not found in class "+p_object.getClass().getName());
throw p_excep;
}
return l_resultObject;
}

java.lang.NoSuchMethodException: java.lang.Class.setValue(com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl)
at java.lang.Class.getMethod(Class.java:1581)
at com.ge.industrial.gdsn.messaging.batch.file.xml.req.MethodInvoker.invokeMethod(MethodInvoker.java:32)
at com.ge.industrial.gdsn.messaging.batch.file.xml.req.RequestCreator.addToRequest(RequestCreator.java:166)
at com.ge.industrial.gdsn.messaging.batch.file.xml.req.XMLItemCreator.addElement(XMLItemCreator.java:191)
at com.ge.industrial.gdsn.messaging.batch.file.xml.req.XMLItemCreator.createXMLFile(XMLItemCreator.java:140)
at com.ge.industrial.gdsn.messaging.manager.ItemManager.createItemXMLFile(ItemManager.java:331)
at com.ge.industrial.gdsn.messaging.batch.ItemProducer.produceItems(ItemProducer.java:58)
at com.ge.industrial.gdsn.messaging.batch.ItemProducer.start(ItemProducer.java:40)
at com.ge.industrial.gdsn.messaging.batch.GDSNDataPoolInterface.main(GDSNDataPoolInterface.java:53)



regards
Prashanth
12 years ago
Hi
I have an arrayList in java, which has some values. I need to read each value in the XSL. When ever i am trying to
read the arrayList in XSL,it gives me the whole arrayList.

These are the values for me in the ArrayList:
[New, InitialLoad, InitialLoad, New, InitialLoad, InitialLoad, New, InitialLoad, InitialLoad, InitialLoad, New, InitialLoad, InitialLoad, New, InitialLoad, InitialLoad, New, InitialLoad]

I have set the arraylist as a paramter to XSLT which is reading the arrayList but when i read the arrayList with the help of below XSL code,i get all the values of the arrayList as a whole and not one-by-one

My XSL code:

<xsl:param name = "triggerModles">
<xsl:value-of select="$triggerModles" />
</xsl:param>



thanks in advance
regards
Prashanth
probably you will have to read everything what I have written, you might understand my question
Hi
I have a XML file which I read and convert that to a CSV file using the Transformer class. It wirtes the data exaclty but I have to get only specific values from XML based on the inputs.

<Product ModelNumber="A3316ABSBB">
<DataSource Name="SPP">
<Column Name="CARTON_LENGTH">31.3</Column>
<Column Name="PROD_DEPT_NAME">REFRIGERATION</Column>
<Column Name="SUPERSEDED_DATE">1900-01-01</Column>
<Column Name="NET_WEIGHT">144</Column>
<Column Name="SKU_DESCRIPTION">16 cu ft, wire, recessed handl</Column>
<Column Name="WHITE_GOOD">Y</Column>
</Product>
<Product ModelNumber="A3316ABSWW">
<DataSource Name="SPP">
<Column Name="CARTON_LENGTH">31.3</Column>
<Column Name="PROD_DEPT_NAME">REFRIGERATION</Column>
<Column Name="SUPERSEDED_DATE">1900-01-01</Column>
<Column Name="NET_WEIGHT">144</Column>
<Column Name="SKU_DESCRIPTION">16 cu ft, wire, recessed handl</Column>
<Column Name="WHITE_GOOD">Y</Column>
</Product>

Above is my XML file. In this way I will have thousands of attributes, I will have to retireve the data only for specific modelnumbers.

Below is my code which wrks fine and retireves all the models into a CSV file:

TransformerFactory factory = TransformerFactory.newInstance();
StreamSource streamSource = new StreamSource(styleSheetName);
Transformer transformer = factory.newTransformer(streamSource);
XMLReader reader = XMLReaderFactory.createXMLReader();
//sourceXmlReader and xsltResultWriter is passed as an inputstream and outputstream
InputSource sourceReader = new InputSource(sourceXmlReader);
Source source = new SAXSource(reader, sourceReader);
Result result = new StreamResult(xsltResultWriter);
for (String parameterName : this.getParamaters().keySet())
{
transformer.setParameter(parameterName, this.getParamaters().get(parameterName));
}
transformer.transform(source, result);
sourceXmlReader.close();
xsltResultWriter.close();

regards
Prashanth
Hi,
I have done the comparision using normal java code. I just need to know as to how I can copy a particular row from one sheet to another. As I have the matching rows, i just need to copy the rows to a new sheet.


regards
Prashanth
12 years ago
Hi,
I have two excel files and i have to compare two columns in the both the excel files and get the matching data from the first sheet. I am able to compare the two sheets and get the common data. I have the exact row numbers which are common in both the excel files.
Can someone help me as to how I can pick the exact rows from the excel sheet using POI. I will be passing the row number and need to retreive the whole row and copy in a new sheet.

regards
Prashanth







regards
Prashanth
12 years ago
I am pretty new to javascript. So I am looking for some sample code pieces so that I can start on this.
Following is my requirement:

I have an array of 1000 values. I have a text box and a list box in the page. When ever the user enter a character in the text box all the related values of that character from the array should be displayed in the list box. For this i need to write a java script which does this job. Need help on this please

Thanks in advance
Prashanth
Hi All,
I have writte a query which retirves data from table using the rownum attribute which works fine:

select * from (select id,count(*) from average a where rownum <= (select count(*) from average) group by id) where rownum < 65501

But when I am trying to retieve the value above 65501 I am not able to fetch the records from the table. Please fine the below which is not working

select * from (select id,count(*) from average a where rownum <= (select count(*) from average) group by id) where >= 65501

Can anyone please let me know how I can retireve the data based on the above query.

Thanks in advance
regards
Prashanth
13 years ago
Hi
Have set the classpath for the classes I have compiled and also put them in WEB-INF/lib folder. But still facing the same issue



regards
Prashanth
13 years ago