File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes problem while parsing xhtml into structured xml using xslt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "problem while parsing xhtml into structured xml using xslt " Watch "problem while parsing xhtml into structured xml using xslt " New topic

problem while parsing xhtml into structured xml using xslt

komal sutaria

Joined: Mar 26, 2007
Posts: 10

I am trying to convrt xhtml document into structured xml document using xslt. I tried with fetching title from my xhtml file. my xslt script is given below.and result i am getting with this script.
can anyone point out the problem of why this script fetches text of whole file instead of just text of title witin <title> tag ?

my script is :
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:xhtml="">
<xslutput method="xml" indent="yes"/>
<xsl:template match="xhtml:html/xhtml:head">
<TITLE> <xsl:value-of select="xhtml:title"/></TITLE> </xsl:template>

OUTPUT : <?xml version="1.0" encoding="UTF-8"?>
<TITLE xmlns:xhtml="">Association between hyperglycemia and the no-reflow phenomenon inpatients with acute myocardial infarction -- Iwakura et al. 41 (1): 1 -- Journal of the American College of Cardiology</TITLE>

J Am Coll Cardiol, 2003; 41:1-7 � 2003 by the American College of Cardiology Foundation This Article Figures Only Full Text Full Text (PDF) Alert me when this article is cited Alert me if a correction is posted Services Email this article to a friend Similar articles in this journal Similar articles in PubMed Alert me to new issues of the journal Download to citation manager Cited by other online articles Google Scholar Articles by Iwakura, K. Articles by Fujii, K. Articles citing this Article Search for Related Content PubMed PubMed Citation Articles by Iwakura, K. Articles by Fujii, K. CLINICAL STUDY: MYOCARDIAL INFARCTION AND ACUTE CORONARY SYNDROME Association between hyperglycemia and the no-reflow phenomenon inpatients with acute myocardial infarction Katsuomi Iwakura, MD*, Hiroshi Ito, MD, FACC*,*, Masashi Ikushima, MD*, Shigeo Kawano, MD*, Atsushi Okamura, MD*, Katsuaki Asano, MD*, Tadashi Kuroda, MD*, Koji Tanaka, MD*, Tohru Masuyama, MD, Masatsugu Hori, MD and Kenshi Fujii, MD* * Division of Cardiology, Sakurabashi Watanabe Hospital, Osaka University, Osaka, Japan Department of Internal Medicine and Therapeutics, Graduate School of Medicine, Osaka University, Osaka, Japan Manuscript received August 13, 2002; revised manuscript received September 12, 2002, accepted September 20, 2002. * Reprint requests and correspondence: Dr. Hiroshi Ito, Division of Cardiology, Sakurabashi Watanabe Hospital, 2-4-32 Umeda, Kita-ku, Osaka 530-0001, Japan. itomd{at} OBJECTIVES: We investigated the association between hyperglycemia and the no-reflow phenomenon in patients with acute myocardial infarction (AMI). BACKGROUND: Hyperglycemia is associated with increased risks of heart failure, cardiogenic shock, and death after AMI, but its underlying mechanism remains unknown. METHODS: A total of 146 consecutive patients with a first AMI were studied by intracoronary myocardial contrast echocardiography (MCE) after successful reperfusion within 24 h after symptom onset. Two-dimensional echocardiography was recorded on day 1 and three months later to determine the change in the wall motion score (WMS; sum of 16 segmental scores; dyskinesia = 4 to normokinesia = 0). RESULTS: The no-reflow phenomenon was found on MCE in 49 (33.6%) of 146 patients; their glucose level on hospital admission was significantly higher than that of patients who did not exhibit this phenomenon (209 � 79 vs. 159 � 56 mg/dl; p < 0.0001). There was no difference in glycosylated hemoglobin or in the incidence of diabetes mellitus between the two subsets. The no-reflow phenomenon was more often observed in the 75 patients with hyperglycemia (160 mg/dl) than in those without hyperglycemia (52.0% vs. 14.1%; p < 0.0001). Patients with hyperglycemia had a higher peak creatine kinase level (2,497 � 1,603 vs. 1,804 � 1,300 IU/l; p = 0.005) and a lower WMS (3.7 � 4.8 vs. 5.7 � 4.3; p = 0.01) than did those without hyperglycemia. The blood glucose level was an independent prognostic factor for no reflow, along with age, gender, absence of pre-infarction angina, complete occlusion of the culprit lesion, and anterior AMI. CONCLUSIONS: Hyperglycemia might be associated with impaired microvascular function after AMI, resulting in a larger infarct size and worse functional recovery. Abbreviations and Acronyms AMI acute myocardial infraction CK creatine kinase DM diabetes mellitus ECG electrocardiogram or electrocardiographic HbA1c glycosylated hemoglobin MCE myocardial contrast echocardiography PCI percutaneous coronary intervention TIMI Thrombolysis In Myocardial Infarction WMS wall motion score This article has been cited by other articles: (Search Google Scholar for Other Citing Articles) S. W. Zarich and R. W. Nesto Implications and Treatment of Acute Hyperglycemia in the Setting of Acute Myocardial Infarction Circulation, May 8, 2007; 115(18): e436 - e439. [Full Text] [PDF] C. Bauters, P. V. Ennezat, O. Tricot, B. Lauwerier, R. Lallemant, H. Saadouni, P. Quandalle, O. Jaboureck, N. Lamblin, T. Le Tourneau, and on behalf of The REVE Investigators Stress hyperglycaemia is an independent predictor of left ventricular remodelling after first anterior myocardial infarction in non-diabetic patients Eur. Heart J., March 1, 2007; 28(5): 546 - 552. [Abstract] [Full Text] [PDF]
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

Unless you override it, the default processing that an XSLT stylesheet performs on an element is to copy all its text children to the output, and to process all its element children.

You are overriding the processing for the xhtml:head element, but not for the root element. Therefore the default processing is done for the root element and all its children except the xhtml:head element.

Add this:
komal sutaria

Joined: Mar 26, 2007
Posts: 10
thanks paul
I agree. Here's the link:
subject: problem while parsing xhtml into structured xml using xslt
It's not a secret anymore!