0
XDocument (또는 다른 유사한 라이브러리)를 사용하여 일부 XHTML을 생성하고 싶습니다. 불행히도 중첩 된 태그는 서로가 아닌 동일한 레벨에서 종료됩니다. 누군가이 간단한 문제로 나를 도울 수 있습니까?XDocument를 사용하여 중첩 태그가있는 XHTML 작성
내가 지금까지 가지고하는 것은 :
var html = new XDocument(
new XElement("div", new XAttribute("class", "MyTable"),
new XElement("table",
new XElement("thead"),
new XElement("tr"),
new XElement("th", "Test"))));
이것은 다음과 같은 결과 :
<div class="MyTable">
<table>
<thead>
<tr>
<th>Test</th>
</tr>
</thead>
</table>
</div>
감사합니다. 어리석은 짓을하는 줄 알았어. 방금 찾지 못했습니다. – Rethic